This list is for ruby, not rails...

On Nov 9, 2012, at 2:56, "Ruben S." <lists / ruby-forum.com> wrote:

> (cross post from
> http://stackoverflow.com/questions/13292477/ruby-on-rails-serialize-hash-i=
ncredibly-slow,
> but I haven't gotten an answer yet)
>=20
> I've got a simple model called "Search" used for storing searches. It
> captures the URL params and stores them in an attribute
> :search_criteria, which is serialized as a Hash:
>=20
> serialize :search_criteria, Hash
>=20
> This all works perfectly, but it performs horribly. For only 5 objects,
> the following statements take roughly 0.2 seconds.
>=20
> SavedSearch.all.map(&:search_criteria)
>=20
> If, however, I remove the serialize line (such that search_criteria
> returns a string) the statements take only 0.002 seconds. That's 2
> orders of magnitude difference for deserializing a Hash!!
>=20
> What's happening here? I've tried this on multiple systems, including
> Heroku, and it's the same everywhere.
>=20
> Rails.version =3D 3.2.8
>=20
> Ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
>=20
> --=20
> Posted via http://www.ruby-forum.com/.
>=20