Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't generate const variables as lazy getters #30662

Open
leafpetersen opened this issue Sep 9, 2017 · 2 comments
Open

Don't generate const variables as lazy getters #30662

leafpetersen opened this issue Sep 9, 2017 · 2 comments
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. type-performance Issue relates to performance or code size web-dev-compiler

Comments

@leafpetersen
Copy link
Member

Not high priority, but something to consider.

I see code that looks like:

const int TAG_TYPE_BITS = 3;

Generating code that looks like:

dart.defineLazy(protobuf, {
  get TAG_TYPE_BITS() { 
    return 3;
  },

Would probably be worth just generating direct properties for these kind of things.

@jmesserly
Copy link

Hmmm. We used to optimize more of these, I'm surprised we don't do that here. I think it gets tricky if we're dealing with user classes and ordering issues though, so that may be why we backed off. I did think JSON stuff was still optimized though.

@jmesserly
Copy link

I also think we could do better for lazy getters in general.

@jmesserly jmesserly added type-performance Issue relates to performance or code size and removed dev-compiler-performance labels Apr 19, 2018
@vsmenon vsmenon added the area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. label Jul 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. type-performance Issue relates to performance or code size web-dev-compiler
Projects
None yet
Development

No branches or pull requests

3 participants