artursapek / mondrian

Web-based vector graphics editor
MIT License
1.24k stars 106 forks source link

Speed up Coffeescript compilation #25

Open artursapek opened 10 years ago

artursapek commented 10 years ago

20 seconds is a long time. I want to reduce the cake build compile time to 2 seconds.

Right now the compilation system is as dumb as it gets - it concats all the .coffee files in a certain order and compiles the entire thing at once, every time. Even if you change a single character.

That means it does a lot of redundant work. It's slow and annoying, and will discourage people from working on Mondrian.

Since the source files are already split up, I'm picturing a system that only recompiles individual files that have changed since last time. It could compare whether they are changed using an md5 hash for a file each time.

There's still a question of how the system concats all the JS after doing this. I think it could just strip the surrounding (function() { / }).call(this);s from each individually compiled JavaScript file, concat the results, and re-wrap it all.

This has to happen soon. I plan on taking it on.

Fishrock123 commented 10 years ago

:+1: