Git Product home page Git Product logo

Comments (2)

RogerPodacter avatar RogerPodacter commented on May 21, 2024

Wow no love for this one? Am I finally falling off?

Use case here is this.

Old way:

  1. Generate big SVG or BMP image
  2. Base64 it
  3. 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"

  1. Generate big SVG or BMP image
  2. 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.

Vectorized avatar Vectorized commented on May 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.