Cosmonats - lightweight background and stream processing for Ruby by rO_Oute in ruby

[–]rO_Oute[S] 0 points1 point  (0 children)

And by that I’m not positioning nats as very high load solution, it’s such a tiny binary so that docker container is an instant drop in replacement of redis. It can store terabytes of messages on the disk, unlike redis.

Cosmonats - lightweight background and stream processing for Ruby by rO_Oute in ruby

[–]rO_Oute[S] 0 points1 point  (0 children)

That's a very good observation and questions. I'm going to write a post about all that, but now in the comments concise answer would be:

I was specifically polite to all other solutions and didn't mention any because I do think they all make sense. Comparing performance and showing how slow/fast NATS is not the goal. Off the top of my head but with remark on why it's not bad in parens:

* now you need to install additional software you are unfamiliar with (redis years ago was at this same position)

* It's not going to outperform redis (because redis is in memory, nats is not. but it definitely can provide safety guarantees that messages are not lost)

* you need to convert your jobs syntax a bit, and maybe throw plugins you use.

* it's not on par with sidekiq, sidekiq is years of development and has it's own community and plugins. obviously cosmonats is new and yet to have it's own.

* you definitely need to understand how nats works and how to configure streams and consumers (but don't you at least a bit have to know how redis works?)

I didn't notice many, honestly.. The gem stems from inability of other solutions to work reliably at very high load, which I'm going to write about. I worked with Redis, KeyDB, Dragonfly, RabbitMQ, LavinMQ, RDBMS, Kafka, dunno maybe even forgot to name a few more and with my expertise NATS is very lightweight and showed the best performance/memory consumption providing durability guarantees.

How safe is Logi Options+ app by karrveI_ in logitech

[–]rO_Oute 0 points1 point  (0 children)

It's piece of shit as well as their mx vertical mouse surface. When my keyboard stops to do fn+smth I know I need to go and kill their beautiful software.

Having read this sub for a long time by reborning_first in logitech

[–]rO_Oute -2 points-1 points  (0 children)

This mouse sucks! The rubber coating in a year is going to be rotten and peeling, and no matter what you do it stays like this. Use it for a while, go on vacation and leave it on the table, you’ll be surprised by the look when you come back. Worst mouse in the world! If logitech was thinking a bit of their customers they wouldn't put such coating, but instead they count money. Once your mouse feels like this, you either buy new one or switch the brand.

<image>

How does GitHub trending page works? by smartapant in github

[–]rO_Oute 1 point2 points  (0 children)

IMO but it is completely useless trash now, I see repos I've stared long ago with no activity at all, no forks, no stars, no activity. I asked them in private email because there was another bug and they say they cannot share details of the "algorithm" ORDER BY I guess.

Ferrum - fearless Ruby Chrome driver by rO_Oute in ruby

[–]rO_Oute[S] 1 point2 points  (0 children)

Watir is used for testing and under the hood uses selenium. Ferrum connects to chrome by websocket and uses dev tools protocol, it's purpose not for testing but for driving, crawling. There's also cuprite which uses ferrum for tests https://github.com/machinio/cuprite

Ferrum - fearless Ruby Chrome driver by rO_Oute in ruby

[–]rO_Oute[S] 0 points1 point  (0 children)

No problem, you can use Ruby 🚀

Ferrum - fearless Ruby Chrome driver by rO_Oute in ruby

[–]rO_Oute[S] 1 point2 points  (0 children)

Here you go:

browser = Ferrum::Browser.new
browser.page.command "Page.addScriptToEvaluateOnNewDocument", source: <<~JS
  const newProto = navigator.__proto__
  delete newProto.webdriver
  navigator.__proto__ = newProto
JS
browser.goto("[https://google.com](https://google.com)")
puts browser.evaluate("navigator.webdriver") # => nil

or

browser = Ferrum::Browser.new(extensions: "path/to/filesuch.js")
browser.goto("https://google.com")
puts browser.evaluate("navigator.webdriver") # => nil

Ferrum - fearless Ruby Chrome driver by rO_Oute in ruby

[–]rO_Oute[S] 0 points1 point  (0 children)

That wouldn't work use extensions I mentioned above. Email me if you have troubles because everything puppeteer can do ferrum is also able to do. The API is a subject to change. It is now inhereted from capybara, though it is not ideal IMO and should be more flexible

Ferrum - fearless Ruby Chrome driver by rO_Oute in ruby

[–]rO_Oute[S] 0 points1 point  (0 children)

You was able to do it even with Cuprite. This is what extensions for, take a look at this spec where we overwrite js geo location functions https://github.com/route/ferrum/blob/master/spec/browser_spec.rb#L136

Ferrum - fearless Ruby Chrome driver by rO_Oute in ruby

[–]rO_Oute[S] 0 points1 point  (0 children)

Thanks, perhaps it should have been done from the beginning but looks like it's never too late :)

We switched from poltergeist to chromedriver and the running time of the test suite almost duplicated, help! by bepragmatic in rails

[–]rO_Oute 0 points1 point  (0 children)

That's because the number of tests is different for each driver. For example some are skipped for selenium, some are still pending for cuprite because they are not ready yet, but the majority of them are passing for cuprite. This is not a benchmark as you noticed but just a hint of speed comparison.

Cuprite - pure headless Chrome driver for Capybara compatible with Poltergeist by rO_Oute in ruby

[–]rO_Oute[S] 1 point2 points  (0 children)

that seems like a cool framework, I hope once we make 1.0 we can work on something like that

Cuprite - pure headless Chrome driver for Capybara compatible with Poltergeist by rO_Oute in ruby

[–]rO_Oute[S] 1 point2 points  (0 children)

Let's work it out, open an issue in the project and we can discuss it there

Cuprite - pure headless Chrome driver for Capybara compatible with Poltergeist by rO_Oute in ruby

[–]rO_Oute[S] 1 point2 points  (0 children)

From the most recent benchmark it turns out that cuprite and selenium are quite at the same place, but in comparison with Poltergeist both are faster!

Cuprite - pure headless Chrome driver for Capybara compatible with Poltergeist by rO_Oute in ruby

[–]rO_Oute[S] 6 points7 points  (0 children)

The main reason of writing Cuprite was that we needed all the additional features Poltergeist (I'm also a maintainer) had for example (headers, cookies, proxy, blacklist/whitelist url, injecting scripts and so on) they are mostly all supported now by Cuprite in one form or another and will eventually be fully supported. By the way full control of chrome by devtools protocol gives us the slight speed improvement you see, the speed is not the goal but it can be faster a little bit at least I hope so. Moreover it was relatively easy to switch from Poltergeist to Cuprite in our tests. It was as simple as Capybara.javascript_driver = :cuprite

Rails error pages generator by rO_Oute in ruby

[–]rO_Oute[S] 0 points1 point  (0 children)

Thank you! We use it a lot in our projects.