core-js: [V8] Array.prototype.splice ~100x slower in V3 with symbol polyfill
This seems like it may be similar to #377. We recently discovered a perf issue after upgrading to v3.2.1 from v2 and tracked it down to a call to Array.prototype.splice
that was occurring within a loop. Testing the performance of that method in isolation in environments with core-js/features/symbol
applied revealed a similar issue.
I created a sample benchmark/repro that shows the relative performance with different versions.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 32 (17 by maintainers)
Commits related to this issue
- revert https://github.com/zloirock/core-js/commit/b7d2a2d3daa19615138a693cb79ccc5671ebd57f, #677 — committed to zloirock/core-js by zloirock 5 years ago
I added engine version detection and not calling this feature detection in modern V8. If feature detection or usage of
Proxy
will be required for any other case, I’ll move it to the version, proposed by @schuay.@mathiasbynens in this case, we do not change built-in prototypes, we change
.constructor
property on an instance.core-js
is a polyfill - its job is to add or to change something on built-in prototypes 😄I filed a V8 bug on this as I was recently bit by this, in a different project, as well https://bugs.chromium.org/p/v8/issues/detail?id=13202
It’s definitely not this error. Without any additional information, I can’t say anything.
Feel free to ping me via email or on the tracker.
@schuay not all
RegExp
methods are generics, only a part of them (and, if I understood correctly, which not required for us) allows doing something like in the workaround above. I’ll dig it later, maybe it’s possible…