Rails: to_json too slow

If you need to convert quickly a lot of data into json, don’t use .to_json method, because it takes a lot of time to convert everything into json.
There’s json gem (docs available here: http://flori.github.com/json/) which can convert in no time very large sets of data.

Example:

JSON.generate(data)

Happy coding and faster response times for you app!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>