Comments (6)
At least bytecode size may be smaller.
Anyway this is just "potential" optimization :)
from dart_eval.
@fzyzcjy could you post the benchmarks that indicate that this sort of micro optimisation will have a positive improvement in performance?
from dart_eval.
@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.
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.
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.
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)
- type 'VariableDeclarationImpl' is not a subtype of type 'MethodDeclaration' in type cast
- constructor logic not work HOT 1
- Work with <String, String>{} returns exception type 'String' is not a subtype of type '$Value' of 'key' HOT 2
- Does it support Singleton pattern??? HOT 3
- Could not find declaration "File" at unknown (file package:example/main.dart) HOT 8
- Unnecessary casting
- what is the difference between $int($value.hashCode) and __hashCode ? HOT 9
- type 'BridgeEnumDef' is not a subtype of type 'BridgeClassDef' in type cast
- Null check operator used on a null value HOT 1
- how to write a wrapper for TopLevelVariableDeclaration? HOT 2
- CompileError: Unknown method dynamic.read at "ref.read(1)"
- Null check operator used on a null value
- Cannot access null value from map
- How to write a Wrapper for extension?
- Support short-circuit evaluation for && operator HOT 3
- Add support for functions that returns List<UserModel>
- Add support for string & some math functions like toStringAsFixed, abs(), double.infinity
- Multiple ( ? ) null check operator in nested optional object - not work.
- Kindly add support methods like fold, contains in List<Some>
- kindly add support for Spread Operator (...)
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 dart_eval.