Hacker News new | past | comments | ask | show | jobs | submit login

Honestly 5 seconds is an eternity when it comes to modern processors. I'm not convinced that it's a norm and I'm still wondering, what really happens, where that time goes?

"initialising an entire message queue broker, an entire relational database and an entire web server" is just abstract words. Initialization of an entire web server is creating a socket and binding it to 80 port, that's what should be done, but what else happens? Initializing a relational database is something like opening a file. May be read journal, rollback unfinished transaction, but those things could be done after initialization.

I use Java and I'm always trying to improve startup time. Last time I used undertow for tiny project, with jdbc to access remote database. Project started in mere milliseconds and it was much easier to iterate. But every time I enable something monstrous like servlets, hibernate, spring or, save god, java ee, it's always 30+ seconds start time. And I always wondered, why that's happens? I can serve millions of customers in those 30 seconds, I can read gigabytes of data from my HDD and parse millions of XMLs.




It's not so much the startup time (which is ~60ms), but warmup time. Assuming you're using a JITting JVM, it's compiling. There's now work on AOT compilation in HotSpot (and some JVMs already have it), but it really doesn't matter for big, long-running server apps, which are currently HotSpot's forté.


I haven't done startup profiling in detail but I'd expect most of the time to go on waiting for IO. CPUs are fast but opening a database, checking disk for queued messages etc is slow. Startup involves querying the database in our app, so the DB can't do that work after initialisation. There's also network traffic and RPCs happening in that 5 seconds too.

Without a doubt also some algorithmic waste in various libraries that aren't optimised for startup time. Startup time is rarely a metric that products compete on outside the consumer space, so improving it is not normally a priority.

And then yeah, finally the lack of AOT compilation. When Java 9 rolls around I plan to try and see how much difference it makes.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: