On Thu, Sep 24, 2020 at 11:39 AM Guillaume Grossetie
<grosset...@gmail.com> wrote:
>
> Thanks for your answer Ben.
>
> > Perhaps V8 could be made smart enough to distinguish between benign
> > and non-benign prototype tampering but the subset that can be proven
> > safe is probably so small that it's not worth the complexity and
> > overhead.
>
> Yes, I agree.
> Alternatively, could v8 use the pre 7.1 impl of Array#splice when the 
> prototype has been modified?
> Obviously, this is easier said than done and I'm guessing that it might not 
> be an easy task.
> But it's worth noting that the pre 7.1 impl performance (with and without 
> prototype tampering) were similar.
> Not sure how it was all made possible... but it was great for us :)
>
> Anyway thanks again for your input!
> Have a nice day

Older versions of V8 called out to this JS-with-extensions code:
https://github.com/v8/v8/blob/7.0.1/src/js/array.js#L599-L642 - I
don't speak for the V8 team but I don't believe they're looking to
return to that approach.

If Array.p.splice() performance is vital to you, you can try
open-coding it. I did something similar in Node.js a few years ago, to
great effect: 
https://github.com/nodejs/node/commit/d3f8db124463e478420d8bba6fa5cf13af7b4ecb

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-users/CAHQurc9N8HCcKnnpvBFdnGfHRYRoiWF8pSVgqBgRyOP8_2MZfw%40mail.gmail.com.

Reply via email to