Comments (4)
Moved to https://github.com/ethereumproject/sputnikvm/wiki/Performance-Improvements due to #175.
from sputnikvm.
lazy_static
deps is now used in the core sputnikvm crate.
from sputnikvm.
@sorpaas So all these precompiled gas functions need to be utilized with lazy_static
right?
from sputnikvm.
Actually originally this was related to all const variables here (https://github.com/ethereumproject/sputnikvm/blob/master/src/eval/cost.rs#L9). Because Gas
needs to be constructed on the fly and it's not free, it might be a performance issue. (See all the Into::into()
below.)
Still, however, I just realized that Gas
implements Copy
trait, so even if when it is lazy-static-ed it might still not help a lot. A constraint on the Ethereum blockchain is that Gas, although its theoretical max value is U256::max_value()
, it in practice cannot exceed usize::max_value()
. A better way to handle this is probably to make Gas
a type parameter in all VM structs. After that, track the initial provided gas, if that value exceeds usize::max_value()
, use usize
as the type parameter, otherwise, fallback to the full U256
(the conditional check does not need to be in the sputnikvm
library).
The type parameter of gas G
usually only needs Add + Mul + Sub + From<usize>
. In the calculation of memory cost, however, there needs to be a checked multiply which does not belong to a trait, so a custom trait might need to be created for that.
Oops sorry I probably should be more careful when labeling an issue as "good first issue".
from sputnikvm.
Related Issues (20)
- no_std build fails on current Nightly Rust HOT 1
- Refine benchmarks so the measurement would kick in as close to contract execution as possible
- Run code through clippy and apply fixes
- Prepare for Byzantium hardfork HOT 2
- SHL, SHR and SAR opcodes and correcponding Patch interface changes
- Customization of Pre-compiled Contract HOT 3
- Move Byzantium precompiled contracts implementation to the core codebase HOT 1
- Implement CREATE2 opcode
- Implement EXTCODEHASH opcode
- Change gas metering for SSTORE
- Predicting the address of a contract HOT 3
- Improve SputnikVM panic-safety HOT 1
- sputnikvm-network-* are outdated HOT 1
- Loading of configuration values from a file while starting any network or sputnikvm HOT 6
- What is the purpose of last else block in the screen below. HOT 1
- CREAT2 as a transaction type(action)?
- Persistance of the SputnikVM execution HOT 1
- 999
- vm.fire() hangs
- Crates.io version of code will panic on newer rustc due to stricter uninit checks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sputnikvm.