Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby, Tk and Ocra - very slow startup

I'd like to deploy my Ruby application as an .exe file, for windows users. The application uses Tk for the GUI part.

Since I simply couldn't manage to succeed with rubyscript2exe I opted for ocra. Ocra works fine and builds a reasonable sized .exe. HOWEVER the application takes probably 10 seconds to start up. Even though it's really a quite simple tool.

Is there any way to improve startup-times? My guess is that the main issue is uncompressing the tk-libs on every startup...

like image 556
ndbd Avatar asked Dec 31 '25 10:12

ndbd


2 Answers

I had this same issue with Tk, and it wouldn't work when using Ocra with InnoSetup.

I switched to Gtk, and now with Ocra + InnoSetup the GUI appears in 1-2 seconds rather than 10-20.

The reason is that Ocra with InnoSetup doesn't have to decompress the files into a temp directory, making it much faster to load once it's installed. Gtk seems more compatible with Ocra, and it seems to load faster than Tk anyway.

like image 118
Virtuoso Avatar answered Jan 02 '26 00:01

Virtuoso


Try building the executable with the --no-lzma option. The resulting file will start faster (but still slow).

like image 36
user3057969 Avatar answered Jan 02 '26 02:01

user3057969