Simple Serialization Faster Than JSON? (in Ruby)
- by Sinan Taifour
I have an application written in ruby (that runs in the JRuby VM). When profiling it, I realized that it spends a lot (actually almost all of) its time converting some hashes into JSON.
These hashes have keys of symbols, values of other similar hashes, arrays, strings, and numbers.
Is there a serialization method that is suitable for such an input, and would typically run faster than JSON? It would preferable if it is has a Java or JRuby-compatible gem, too.
I am currently using the jruby-json gem, which is the fastest JSON implementation in JRuby (as I am told), so the move will most likely be to a different serialization method rather than just a different library.
Any help is appreciated! Thanks.