mirror of
https://github.com/enso-org/enso.git
synced 2024-12-24 21:43:43 +03:00
6c440beecc
The main culprit of a Vector slowdown (when compared to Array) was the normalization of the index when accessing the elements. Turns out that the Graal was very persistent on **not** inlining that particular fragment and that was degrading the results in benchmarks. Being unable to force it to do it (looks like a combination of thunk execution and another layer of indirection) we resorted to just moving the normalization to the builtin method. That makes Array and Vector perform roughly the same. Moved all handling of invalid index into the builtin as well, simplifying the Enso implementation. This also meant that `Vector.unsafe_at` is now obsolete. Additionally, added support for negative indices in Array, to behave in the same way as for Vector. # Important Notes Note that this workaround only addresses this particular perf issue. I'm pretty sure we will have more of such scenarios. Before the change `averageOverVector` benchmark averaged around `0.033 ms/op` now it does consistently `0.016 ms/op`, similarly to `averageOverArray`. |
||
---|---|---|
.. | ||
Benchmarks | ||
Examples_Tests | ||
Geo_Tests | ||
Google_Api_Test | ||
Image_Tests | ||
micro-distribution | ||
Table_Tests | ||
Tests | ||
Visualization_Tests |