5 ms·
Are compilation times still incredibly slow? That was the deal breaker for me with crystal, toy project of maybe a few hundred lines of code taking 30+s to com
by shawabawa3 8y ago
Are compilation times still incredibly slow?
That was the deal breaker for me with crystal, toy project of maybe a few hundred lines of code taking 30+s to compile
edit: specifically a static release compile, with
shards build --no-debug --release --link-flags "-static"
- artifinch 8y agoI’ve been using crystal for moderately sized personal projects for a few months now - I’ve never experienced any unreasonable compilation times. If you tried crystal a long time ago, I’d recommend giving it another shot!
- asterite 8y agoThe compiler takes about 30 seconds or a bit more to compile, and it has around 50000 lines of code. Do you have the few hundred lines that took you 30+s to compile?
- shawabawa3 8y agoJust dug out the code and tried again It's 80 lines and depends on kemal, radix and kilt `shards build --no-debug --release --link-flags "-static"` takes ~60s I can't send the full code atm, but it basically just fetches json from an endpoint, stores it in memory, and returns it in a different format on an http endpoint
- asterite 8y agoOh, release builds do take longer. My point of view is that while developing you don't need the `--release` flag, so you can get a more or less fluent experience. The few times where you need to release an app it takes longer, but for me that's acceptable.
- ModernMech 8y agoI always like flipping on the release flag at then end of my work day. I treat it like a stopping point in my code, where I get to see how fast it is compared to the slow running debug executables I’d been working with all day. Great way to end a coding session.
- RX14 8y agoI rarely notice the difference between release and debug executables unless i'm benchmarking or doing something super CPU heavy. I've so far deployed most of my crystal apps in debug mode because it makes the stack traces nicer because of the lack of aggressive inlining.
- sam0x17 8y agoOur ~100k line web app takes 10-15 seconds to compile.
- RX14 8y agoIf your few hundred lines of code takes 30 seconds to compile, then either it's a crazy macro that expands to hundreds of thousands of lines of code, or I suggest you report it on github.