3 ms·
The readme file in the repo mentions a ~500ms start up time. Maybe it's just me, but I wouldn't want to wait half a second for a tool to start running. For cont
by nickjj 6y ago
The readme file in the repo mentions a ~500ms start up time. Maybe it's just me, but I wouldn't want to wait half a second for a tool to start running. For context most popular Unix tools start up in 1-2ms.
- pzmarzly 6y agoOn my PC: time node -e "console.log('a')" # 0.377 total time ruby -e "p 'aaa'" # 0.084 total time python3 -c "print('a')" # 0.020 total time elixir -e "IO.puts 'a'" # 0.117 total time _build/prod/rel/bakeware/simple_script Hi # 0.205 total without zstd, 0.212 with Another question is which language loads modules the fastest (afaik Ruby is kind of slow when it comes to `require`).
- YorickPeterse 6y ago> Another question is which language loads modules the fastest (afaik Ruby is kind of slow when it comes to `require`). I think both Python and Ruby loosely follow a similar model. The difference is that IIRC Python caches bytecode files, while Ruby compiles them from scratch every time. Not sure how big of a performance impact that has, especially for simple cases like this. And just to toot my own horn, using Inko (https://inko-lang.org/ https://inko-lang.org/), I get: inko /tmp/test.inko # 0.470 total Note that this invokes the horribly slow Ruby compiler currently in use. If you invoke the VM directly on the compiled bytecode, it only takes about 10 milliseconds to run. Using the `master` branch: vm/target/release/ivm /home/yorickpeterse/.cache/inko/bytecode/release/43/38021ddc9a3449ace13288a2fac894d1d3e2aaa.ibi # 0.008.8 total In this case all modules (including the standard library) are included in the bytecode file, meaning no disk IO is necessary, and modules can be parsed in parallel. This is something dynamic languages like Ruby and Python can't do, as loading modules is something that can be done anywhere at any time, so you have to process them one by one.
- johnisgood 6y agoPerl's startup time is pretty good.
- vendiddy 6y agoI wouldn't use Elixir for short lived cli commands because of startup time. For that I'd probably turn to Go or Rust. However for distributing long running server apps--where Elixir shines--I'm happy with this start-up time.