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

Most upvoted comments

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

I experienced the same issue with v3 in Internet Explorer 11, but not in other browsers, so we had to rollback to v2 because IE 11 was completely frozen. Is it a known issue or has anyone else experienced the same? Appreciate any help on this, since we are currently stuck on the legacy core-js v2 and can’t upgrade because we have to support IE 11.

It’s definitely not this error. Without any additional information, I can’t say anything.

@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…

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…