-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
turn transform into a simple for
loop
#3477
Conversation
Current coverage is
|
Thanks! I'm surprised it was that much of a difference. Are you using |
Native |
Totally, but I would not have expected the top level transform function to be called enough to matter, hence my surprise. |
We could also use |
@loganfsmyth nah, just a real standard config. I bet it'd do even better for those folks using |
@hzoo Are you sure that works? An optimization like that sounds handy but I don't observe that doing anything special in the output code, even in building Babel itself. |
I'm all for expressive code, but the transform function is HOT. Profiling my webpack build, the function accounts for ~20% of the ticks. This is verified through my webpack build times: I reduced my build from ~12 seconds to ~10 seconds.
Before:
After:
I'm not saying we should do this for every
forEach
, but a 20% reduction in build times just for changing a loop type seems like an easy win.