|
|
|
|
|
by h2s
4598 days ago
|
|
Couldn't agree more. I made the mistake of using Ruby to build a CLI application too, and distribution is a massive hassle. At the moment I'm still at the awkward stage of distribution via Rubygems which the article advises strongly against, and I'd add "Gem startup time cripples your performance" to the article's point about Rubygems being difficult for non-Rubyists. |
|
EDIT: Strike that - I just realised one of my apps gets 117,000 ENOENTs from trying to handle require's during startup....
EDIT: I keep wanting to write something to cache the paths, but haven't had time. I'd be perfectly happy to be forced to regenerate cache on first run after any gem update. The 117,000 ENOENT's above comes from ending up with a $LOAD_PATH of about 100 entries, where the worst case causes almost every one of those directories to be checked for both foo.rb and foo.so. Something like 99%+ of startup time of most of my Ruby code is overhead added by rubygems way of handling require.
EDIT: Actually, a lot of this might be down to bundler rather than rubygems in some cases.
EDIT: This is not a robust solution, but this little ugly helper combined with wrapping only the two require statements shown, reduced the number of failed stat() calls for my app from 117,000 to 104,700 on startup...
EDIT: Wrapped a handful more require statements with "with_gems". Down to 76,000 failed stat()'s... I should have done this before.EDIT: Yikes. 32,000...