FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Read file before creating directory by timneutkens · Pull Request #644 · babel/babel-loader · GitHub

Read file before creating directory - #644

Merged
loganfsmyth merged 1 commit into
babel:masterfrom
timneutkens:read-file-before-dir
Jul 29, 2018
Merged

loganfsmyth merged 1 commit into
babel:masterfrom
timneutkens:read-file-before-dir

Conversation

timneutkens commented Jul 22, 2018
edited
Loading

Copy link
Copy Markdown
Contributor

After spending some time debugging where babel-loader compile time goes I found out that it tries to run mkdirp to create the cache directory for every possible file that's passed to babel-loader. This change makes sure that it only tries to create the directory if something has to be written to it.

This is still not ideal as it tries to create the directory for every file that's not there (this can take from 0 to 50ms per file from benchmarks I ran on a relatively large app (220 webpack entrypoints and around 1000 components)).

The most performant solution is keeping track of directories that were already created using a new Set(), but that seems to fail the tests as after every test the directory is removed and the internal cache remains.

loganfsmyth merged commit 6a70942 into babel:master Jul 29, 2018
timneutkens deleted the read-file-before-dir branch July 30, 2018 09:14

Copy link
Copy Markdown

Hi!

The most performant solution is keeping track of directories that were already created using a new Set(), but that seems to fail the tests as after every test the directory is removed and the internal cache remains.

How much of a performance improvement did that change make on top of this PR? (Wondering if it's worth pursuing further..)

Copy link
Copy Markdown
Contributor Author

It definitely is worth pursuing, but I couldn't get the tests not to fail when implementing the Set solution. Feel free to investigate 👍

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL