News for hackers. Stuff that matters.
Re:Types will be part of Ruby 3 stdlib source by bjoli on Friday April 19, 2019 @08:33AM (#19699011)
Python and ruby have about the same speed for most common tasks (or at least in the same ballpark), IE: dirt slow once you leave the comfort of the fast parts of the runtime that are written in C.

In reality this is fast enough for most tasks.

Re:Types will be part of Ruby 3 stdlib source by aasasd on Friday April 19, 2019 @08:46AM (#19699099)
The thing is, I do some Python programming for money, and I'm having a hard time imagining what the Brew team did to make `brew search` and its other parts so slow. I'd probably have to compare strings byte by byte in Python code for that.

Might have to learn me some Ruby just to figure out this mystery.

Re:Types will be part of Ruby 3 stdlib source by bjoli on Friday April 19, 2019 @09:53AM (#19699614)
The slowness of brew isnt ruby's fault. They don't keep a local cache of the taps, but instead searches for taps using an API that interfaces with github and searches local taps, remote taps, then blacklisted taps and then probably something more. It is limited by network speed, not by string searching.

Edit: explained better here: https://github.com/Homebrew/brew/issues/3056#issuecomment-32...

Re:Types will be part of Ruby 3 stdlib source by aasasd on Friday April 19, 2019 @10:06AM (#19699695)
It's not limited by network speed because I have HOMEBREW_NO_GITHUB_API and HOMEBREW_NO_AUTO_UPDATE enabled. It's not like I just today stumbled into the problem.

Brew's not even consuming much system cpu time during `brew search`, despite hogging a core for a full minute.

Even just `brew help` takes almost 10 sec cold.

Re:Types will be part of Ruby 3 stdlib source by wilg on Friday April 19, 2019 @12:55PM (#19701044)
Are you using JRuby or something? 10 seconds is too long.

> time brew help

> brew help 0.55s user 0.26s system 96% cpu 0.849 total

Re:Types will be part of Ruby 3 stdlib source by aasasd on Friday April 19, 2019 @01:10PM (#19701164)
Regular Ruby 2.5.1. I do have a throttled CPU due to no battery in the MacBook, but I still have Python and other stuff to compare, and Brew (or Ruby) definitely does something wrong on my machine. It's hugely CPU-bound without a particular reason for being so.
Re:Types will be part of Ruby 3 stdlib source by wilg on Friday April 19, 2019 @06:23PM (#19703516)
Weird. I'd guess Brew because MRI Ruby tends to have pretty good boot times.