3 ms·
I know this is a joke, but, this goes right back to the first time I deployed Ruby and had "the speed discussion" with people. We deployed a Ruby queueing serve
by vidarh 3y ago
I know this is a joke, but, this goes right back to the first time I deployed Ruby and had "the speed discussion" with people. We deployed a Ruby queueing server that used 10x as much CPU in the Ruby code than our preceding C version spent in its code (that wording is careful). It was also 1/10th the LOC and had more features, and given we spent ca 1/10th of a 2006-era Xeon core in user space, it felt like a worthwhile sacrifice - the vast majority of time was spent in the kernel handling IO.
It was what made me fall in love with Ruby: There are so many spaces where the time is spent elsewhere and the time spent doing things slowly in Ruby (though much faster than it used to be) doesn't matter.
Like a window manager.
I've even made performance tradeoffs that makes it much slower: On every adjustment of the layout, I iterate over every single window the WM knows about to filter a list of the wm's on this desktop, that are visible, and compare that to a serialized list of every single window that exists in the layout tree.
Because it's fast enough, and it saves bothering to keep proper track of state, and makes some of the code simpler.
Knowing when you can afford to pick the slow options on purpose is powerful.
Knowing when you can't afford to, is also important.