4 ms·
> E.g. quite recently a scraper, wrote it in Ruby -obviously-, found out that we couldn't get performance acceptable, rewrote it in python How is Python gonna
by montblanc 5y ago
> E.g. quite recently a scraper, wrote it in Ruby -obviously-, found out that we couldn't get performance acceptable, rewrote it in python
How is Python gonna improve performance when writing a scraper, it's mostly about doing a bunch of network requests right? You could do threading in Ruby you know. Both Python and Ruby have a VM lock (GIL, have no idea what it's called in Python).
Python is good choice for scraping due to the many ready made libraries but I don't get how performance was a win over Ruby.
Node is a different story, V8 (and competing JS engines) had huge effort poured into them by Google/Microsoft so it's fast.
Python never had that kind of investment afaik.
We will see if Shopify can narrow the gap between Ruby and JS, I know it's a reach but they already improved Ruby performance around 25-30% since the project started (about a year?). I am optimstic the performance gap will narrow since what makes JS faster is a JIT. There is no magic here, only effort and investment which costs money.
- dragonwriter 5y ago> Both Python and Ruby have a VM lock (GIL, have no idea what it's called in Python). GIL (Global Interpreter Lock) is the Python name. GVL (Global VM Lock) is the Ruby name. Though with Ractors in Ruby 3 it's not actually global (unless one Ractor is a “globe” and a multiractor program is super global.)
- montblanc 5y agoAh yes my bad, confusing names.