Y
Hacker News
new
|
ask
|
show
|
jobs
by
mikemcquaid
3561 days ago
Which is why for certain things like `brew --prefix` we now do it purely in Bash rather than using Ruby ;)
2 comments
barpet
3561 days ago
Why would bash be faster ? Would not you essentially call the same C lib stuff anyway ?
link
s_kilk
3561 days ago
It would at least save the process-start overhead, plus loading the ruby vm and modules/gems.
link
mikemcquaid
3561 days ago
Exactly. For a simple string comparison Bash is far faster (although Homebrew doesn't use require any gems, just FYI).
link
s_kilk
3561 days ago
Good to know, so did the speedup come mostly from not spinning-up the Ruby VM?
link
mikemcquaid
3561 days ago
Yep!
link
pikachu_is_cool
3561 days ago
I guess it's a start. But even still, the most basic of commands take a good 1+ seconds on my machine. What about Ruby makes it necessary to use? What is stopping you guys from moving to something like LuaJIT?
link
mikemcquaid
3560 days ago
Rewriting the entire project in non-Ruby would require a lot of time and create a lot of bugs for little benefit for most users.
link
pikachu_is_cool
3559 days ago
Unfortunate.
link