Skip to content
New issue

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

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

Already on GitHub? # to your account

[Records, dart2js] Optimizations for records #51040

Open
3 tasks
rakudrama opened this issue Jan 17, 2023 · 2 comments
Open
3 tasks

[Records, dart2js] Optimizations for records #51040

rakudrama opened this issue Jan 17, 2023 · 2 comments
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. dart2js-optimization web-dart2js

Comments

@rakudrama
Copy link
Member

rakudrama commented Jan 17, 2023

This is an ad-hoc list of optimizations that will improve dart2js code quality around records

  • Load elimination of literal arrays. Will help to achieve scalar replacement of large records.
  • Load elimination (constant folding) of shape property from prototype. Will help with some inlined versions of == and .hashCode.
  • Eager initialization of static variables with sufficiently simple record value.
@rakudrama rakudrama added web-dart2js dart2js-optimization area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. labels Jan 17, 2023
@lin72h
Copy link

lin72h commented Jan 30, 2023

JS's native Record and Tuple proposal is approaching Stage3, Any thought on the future integration of dart's record and js's record? I think this could be a killer feature.

@bernaferrari
Copy link
Contributor

I'm not from the team, but usually the response to these things is "let's wait until it is stable". It might take years. Similarly to the type in JS that everybody thought would be approved and is still in the limbo.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. dart2js-optimization web-dart2js
Projects
None yet
Development

No branches or pull requests

3 participants