GithubHelp home page GithubHelp logo

Comments (6)

fzyzcjy avatar fzyzcjy commented on June 16, 2024 1

At least bytecode size may be smaller.

Anyway this is just "potential" optimization :)

from dart_eval.

maks avatar maks commented on June 16, 2024

@fzyzcjy could you post the benchmarks that indicate that this sort of micro optimisation will have a positive improvement in performance?

from dart_eval.

fzyzcjy avatar fzyzcjy commented on June 16, 2024

@maks These are just potential optimizations :) But we all know, strings are bigger than integers, so storage will be bigger and cpu will be slower. Yes it is a question how much it improves, so we may need to check it before implementing it.

from dart_eval.

ethanblake4 avatar ethanblake4 commented on June 16, 2024

Looking up functions/properties by index is already done for classes defined inside of dart_eval when the concrete type is known. What you're talking about though, if I'm getting this correctly, is actually a sort of global string hash for function/field names? I'm not too sure that would work since you'd have to allocate large arrays for each object and populate all the missing values with null... or maybe I'm not understanding this right. Or maybe there's some way we can reuse indices by checking for collisions... the problem is that you can implements any class in Dart so I don't really know if that's possible.

from dart_eval.

fzyzcjy avatar fzyzcjy commented on June 16, 2024

Well I mean, at least, case 'length' becomes case 2. The "2" is generated by the compiler instead of "length" whenever it sees String.length.

from dart_eval.

ethanblake4 avatar ethanblake4 commented on June 16, 2024

Oh, I see. So it's not an array lookup but just changing the Map key. That would work but probably very minor performance improvement.

from dart_eval.

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.