-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Implement cache #80
Comments
I've been wondering about caching in gulp-babel myself. Is the fancy cache and the hash stuff really necessary? My much more naive cache I just whipped up seems to work great
|
Your solution is effectively leaking memory.
|
ps I have released gulp-babel2 to test LRU. Using it until something about cache is done in gulb-babel. It saves a lot of time on large project (difference between 7 seconds and few ms)
|
@gajus where is this gulp-babel2 located? Github link?
|
https://github.com/gajus/gulp-babel/blob/issue-80/index.js
With codebases as large as thousands of files, memory footprint is a very big issue. |
OK! Thanks for your responses. I hope an official caching gulp-babel gets On Fri, Mar 4, 2016 at 10:48 AM, Gajus Kuizinas [email protected]
Morgan Packard |
I'm curious, how does this compare to using something like |
Based on my reading of gulp-cached, it will not pass a file downstream if it's cached. Useful for linting or other validation, but not so useful for my build system, where I transpile and then concatenate all files in to one big one. To use a separate gulp plugin to cache babel results you'd need something that can still deliver the cached results downstream. Maybe a twopart usage pattern similar to gulp-sourcemaps would be idea. Something like this:
The call to cache.init() would create an object that would intercept previously compiled files with no changes. Cache.write() would output those previously compiled files. If a version of a file doesn't exist in the cache, it passes it on to babel. The tricky thing is that it would have to then cache the results, so would have to remember what the input to babel was and successfully update the cache key, and then wait for the output. I'm too green to gulp to know how difficult this would be. |
Looks like gulp-remember paired with gulp-cached may do more or less what I described above. |
I've achieved this with gulp-changed. |
Closing this issue as it's been inactive for several months. Please feel free to open a new issue or leave a comment asking to reopen this issue. Thanks! ✌️
|
A simple cache using LRU strategy (e.g. https://www.npmjs.com/package/lru-cache).
The text was updated successfully, but these errors were encountered: