News for hackers. Stuff that matters.
Re:Ruby 3.3 by the_gastropod on Monday December 25, 2023 @12:03PM (#38764161)
But, like, why do you need a 1MB json response? That’s probably either a bad design or a use-case Rails is not designed for.
Re:Ruby 3.3 by jupp0r on Monday December 25, 2023 @12:11PM (#38764237)
It's a paginated list of 1000 objects of 1kb size each. Any nontrivial API will have responses like that.

My entire point was that Rails is not designed for this.

Re:Ruby 3.3 by the_gastropod on Monday December 25, 2023 @12:16PM (#38764287)
But you could return the 1000 objects (or less? 1000 records sounds like a lot for any UI to show at once) of 1kb size and allow the clients to request specific pages with a request parameter. There may be applications where you need to ship the full 1M records I guess, but that seems like very much an edge case as far as web apps go.
Re:Ruby 3.3 by tauchunfall on Monday December 25, 2023 @01:18PM (#38764757)
True, you would not return 1000 objects at once to the frontend.

I first thought it's just a backend use-case, where processing 1000 records in a paginated result is common, but the parent mentions "rails", so it sounds like a frontend use-case.

Re:Ruby 3.3 by jupp0r on Monday December 25, 2023 @01:30PM (#38764848)
It's a backend use case.
Re:Ruby 3.3 by wredue on Monday December 25, 2023 @01:03PM (#38764643)
1,000 records is absolutely not a lot on modern computers or connections. On a business LAN, this request should take well under a second full latency.

On an average mobile connection, it’s maybe a second or so.

Re:Ruby 3.3 by the_gastropod on Monday December 25, 2023 @11:44PM (#38768985)
You’re right. It’s not a lot for a machine. The point isn’t the speed capability. It’s why? What UI has 1,000 rows in, e.g., a table all at once (much less 1M)?
Re:Ruby 3.3 by jupp0r on Tuesday December 26, 2023 @02:15AM (#38769543)
Your assumption that humans consume this data is wrong. It's actually machines that need it.
Re:Ruby 3.3 by radus on Tuesday December 26, 2023 @02:34AM (#38769620)
Many plots contain thousands of data points. Eg: 10 x 100 heatmap which supports sorting by various metadata. This is a common visualization for biological data where your data matrix is samples x proteins, so potentially much larger than 1000 data points.
Re:Ruby 3.3 by wredue on Monday December 25, 2023 @01:00PM (#38764611)
The better question is

“Why would I pointlessly accept this clear case of massive technical debt for literally no reason what-so-ever?”

Rails does not present any sort of promise that go does not also present, so just saying “yeah, I’ll handcuff my app like this cause I feel like using Ruby” is, frankly, absurd.

When you ask the right questions, you never land on Ruby, and that’s why Ruby continues to decline.

Re:Ruby 3.3 by Lio on Tuesday December 26, 2023 @05:29AM (#38770502)
It depends on the metrics you care about.

Ruby is concise compared to Go though. I like Go and but when I use it I have to accept that I'll write (and debug) at twice as much code as I would do in Ruby.

If you're mostly just loading data into a large fast cache, lines of code may be a more critical dimension than execution speed.

That's how well designed Rails projects work and you get most of what you need straight out of the box.