Comments (2)
Wow no love for this one? Am I finally falling off?
Use case here is this.
Old way:
- Generate big SVG or BMP image
- Base64 it
- Append it to a JSON string using a DynamicBuffer
End result being a JSON string with the image in B64 format at the end.
"Proposed new way"
- Generate big SVG or BMP image
- Base64 it while simultaneously appending the B64 data to the buffer!
End result is the same!
In my informal testing it was up to a 10% gas savings for large BMPs.
Mainnet Etherscan has a ~100M read gas limit so if you want the "cred" of an "on-chain" NFT that shows a ton of data for tokenURI there, you need to think about gas!
Thoughts?
from solady.
I think keep as separate functions for now.
If someone is actually hitting the gas limit, try using LibString.directReturn
first.
from solady.
Related Issues (20)
- ✨ More JSONParserLib functions
- 📖 Use of biblical comment not correct HOT 1
- ✨ Add SafeTransferLib permit support HOT 6
- 🚨 FixPointMathLib log functions will NOT revert for zero inputs
- 📏 EIP-6093 HOT 4
- ♻️ Remove increaseAllowance and decreaseAllowance from main ERC20 contract
- ✨ EIP712 view name and version HOT 6
- 📝 Adjust SafeTransferLib docs to more accurately reflect vulnerability related to usage of force invariants HOT 2
- 🪙 ERC223 HOT 1
- 🗞️ Calldata Compressed Proxy HOT 3
- ✨ parseUintFromHex HOT 2
- 📎 ERC173 auth lite HOT 4
- 🚨 Unexplained revert of SSTORE2.write in Foundry invariant testing HOT 1
- ✨ Adding ability to pack extra-data with balance in `ERC20` HOT 3
- ✨ LibPRNG gaussianWad HOT 1
- ♻️ Rename all `rawOp` functions to `_op`? HOT 1
- ✨ Signed variants of wad math
- Add `toHexStringChecksumed` as an alias for `toHexStringChecksummed` HOT 4
- . HOT 1
- ✨ RingBufferLib HOT 3
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 solady.