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
Functions used as keys in map are slow #14847
Comments
Is this with the Dart VM or dartj2s (or both?) |
This comment was originally written by nbily...@gmail.com Just the Dart VM |
Removed Type-Defect label. |
Added Performance label. |
Could you please provide a small Dart program that exhibits the slow performance. Thanks. |
This comment was originally written by nbilyk...@gmail.com I've attached a benchmark harness. I'm running In the Dart VM method closures all have the same hashCode, and are very slow within Maps. When using dart2js and running the same code through JavaScript, the hashCodes are different and performance is good. With 1000 references there was a 200x performance difference. Attachment: |
This comment was originally written by @tatumizer same with reflection: } |
This issue was originally filed by nb...@gmail.com
If you create a map with the key being type Function, the map can have very slow performance. I believe this is due to Functions with the same signature will have the same hashcode.
The text was updated successfully, but these errors were encountered: