Skip to content

Refactor traversal to avoid closures for perf#433

Merged
sebmck merged 1 commit intobabel:masterfrom
gaearon:perf-traverse-refactor
Jan 10, 2015
Merged

Refactor traversal to avoid closures for perf#433
sebmck merged 1 commit intobabel:masterfrom
gaearon:perf-traverse-refactor

Conversation

@gaearon
Copy link
Copy Markdown
Member

@gaearon gaearon commented Jan 9, 2015

This commit completely removes closures from the hottest method ever, traverse.

Combined with #432, this gives 38% improvement over master (130 ms vs 212 ms on my benchmark).
Alone, this gives 24% improvement over master (162 ms).

@gaearon gaearon force-pushed the perf-traverse-refactor branch 2 times, most recently from 33bf036 to 32ec805 Compare January 9, 2015 15:46
@gaearon
Copy link
Copy Markdown
Member Author

gaearon commented Jan 9, 2015

Oh wait, I think I see a way to avoid some allocations.

Nevermind. Doesn't help at all so let's stick with this for now.

@sebmck
Copy link
Copy Markdown
Contributor

sebmck commented Jan 10, 2015

@gaearon This looks really good. The traversal stuff really needed a refactor but I haven't gotten around to it. Can you do a rebase so I can merge?

@gaearon gaearon force-pushed the perf-traverse-refactor branch from 32ec805 to a4e6da2 Compare January 10, 2015 11:01
@gaearon gaearon force-pushed the perf-traverse-refactor branch from a4e6da2 to 421906b Compare January 10, 2015 11:02
@gaearon
Copy link
Copy Markdown
Member Author

gaearon commented Jan 10, 2015

Done!

sebmck added a commit that referenced this pull request Jan 10, 2015
Refactor traversal to avoid closures for perf
@sebmck sebmck merged commit 9d4bea7 into babel:master Jan 10, 2015
@sebmck
Copy link
Copy Markdown
Contributor

sebmck commented Jan 10, 2015

Thanks!

@gaearon
Copy link
Copy Markdown
Member Author

gaearon commented Jan 10, 2015

Thanks for quick merge!

@gaearon gaearon deleted the perf-traverse-refactor branch January 10, 2015 11:41
@sebmck sebmck mentioned this pull request Jan 13, 2015
JacopKane pushed a commit to JacopKane/babel that referenced this pull request Jan 11, 2018
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 8, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants