Skip to content
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

Cache compiled code. #21

Merged
merged 1 commit into from Oct 7, 2011
Merged

Cache compiled code. #21

merged 1 commit into from Oct 7, 2011

Conversation

sixcircuit
Copy link
Collaborator

I added caching to the require extension to avoid redundant recompilation of scripts. Recompilation isn't terribly slow, but for my purposes, it's too slow. A hidden compiled file is created in the same directory as the source file, and is used if the mtime on the source file isn't more recent than the cached version. I append a version number to the cache file name, in case you make breaking changes you can just increment the number, and the next version won't pickup cached versions compiled with older engines. I put the cached file in the same directory as the source because there is less chance of a file name collision, than if we store them locally in module's tree, and if you need to debug the file, you have a copy right next to your source. This one might not be for everybody, but I think it's pretty unobtrusive.

@maxtaco maxtaco merged commit b7db126 into maxtaco:master Oct 7, 2011
@maxtaco
Copy link
Owner

maxtaco commented Oct 7, 2011

Looks good, thanks Kendrick.

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.

None yet

2 participants