Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Use Array::slice when rest pattern is an identifier #8

Open
natefaubion opened this issue Jan 21, 2014 · 3 comments
Open

Use Array::slice when rest pattern is an identifier #8

natefaubion opened this issue Jan 21, 2014 · 3 comments

Comments

@natefaubion
Copy link
Owner

Currently, the for loop to copy the array elements is inlined. We should optimize for the case where the pattern is just an identifier and we can just slice.

@michaelficarra
Copy link

You may not want to do that just yet due to a v8 optimisation bug. See jashkenas/coffeescript#3274.

@natefaubion
Copy link
Owner Author

Interesting! In the original matches.js lib, I used a manual arguments copy to speed up dispatch time. That must be why.

@natefaubion
Copy link
Owner Author

I may leave the for loop in for arguments, but do slice for actual arrays.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants