One can mitigate the problem somewhat using the `--disable-gems` flag, but that's not a good general solution.
One can mitigate the problem somewhat using the `--disable-gems` flag, but that's not a good general solution.
[borg@cube] time ruby -e 'nil'
real 0m0.007s
$ ruby -v
ruby 3.3.1 (2024-04-23 revision c56cd86388) [x86_64-linux]
$ time ruby -e ''
real 0m0.122s
user 0m0.102s
sys 0m0.020s
I found an old Reddit thread also hinting at bad start-up times: https://old.reddit.com/r/ruby/comments/aqxepw/rubys_startup_....Of course, if you need more peformance, you need to go for newer stuff.
Actyally that miniruby is pretty usefull. For basic stuff. Also, its very easy to build static ruby containing all extra stuff you care about, like Win32 API for example.
I myself have custom ruby binary on Win32 (Cygwin) with GRX library added in, So I can do basic graph stuff directly from ruby :) That stuff is written in it:
> For basic stuff. Also, its very easy to build static ruby containing all extra stuff you care about, like Win32 API for example.
Wow, this reminds me abit of MRuby. So I could basically ship a script with the self-contained ruby executable instead of having to force users to install Ruby on their machine? How can I get ahold of miniruby? Or is there any resource somewhere that I can dig into?
Hard to say about new Ruby versions like 3.x or even 2.x. 1.8.x have pretty simple building process, just grab the old source. You can use --enable-static builds there. Miniruby is build by default, always, because its part of building process.
Also, if you are platform are you targeting? Win32 only?
I wonder if experimenting miniruby with cosmopolitian would help with that?
But Idk, I’m just thinking loudly and probably missing a huge detail which would make the idea non-working.
Also, thanks for the linked resource, I’ll definitely give it a go!