Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I guess that, since JSON is Javascript Object Notation, it should be faster for Javascript to serialize/deserialize it, but it might be just a psychological bug of mine. Anyway, my main point wants to be the fact that JSON serialization/deserialization seems an area of improvement on API web apps. As a Rails developer it requires a lot of effort to deal with that part of the application performance. Just providing a list of 50 db records with 10 attributes each, with some transformations (let's say that e.g. 4 attributes are virtual and some keys are renamed), add an important overhead to the response.


Most interpreted languages have a C library that handles JSON serialization and deserialization.


Yes, but are they as fastest as possible?

Take Ruby. One of the most common improvements you do as Rails developer to a Rails web app is adding `oj` gem, which replaces the default JSON ser/deser with a more performant one. But it doesn't come by default with Rails. Can you guess how many Rails web apps performing JSON ser/deser don't use it? I'd be curious about that.

Moreover, it's really hard to find a presenter library oriented to performance. There are wonderful DSLs, but none of them seems optimized to speed, IMHO.


JS VMs are generally better engineered than Ruby VMs due to more investment, including better JSON handling code yeah. But that’s nothing to do with JSON being (almost) a subset of JavaScript. Unless you can think of a concrete reason why?


> JS VMs are generally better engineered than Ruby VMs due to more investment

Is that still true? Shopify is investing a whole lot (u don't need me to tell u of course). Yes I know Google/Firefox etc had teams working on JS but did they invest that much more than Shopify?


Yes, both in terms of money and dev-hours, I wouldn’t be surprised if Google put 2 orders of magnitude more resources into V8.

Nonetheless, Shopify’s investment into truffleruby may well be worth it, as it builds on top of the many many work-hours that went into the JVM.


Nono, I agree with you, I think I was wrong above, as I wrote above it was probably just a psychological bug. But I still think there's much room of improvement with the tools we already have.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: