From: "Shot (Piotr Szotkowski)" Date: 2008-02-22T04:01:46+09:00 Subject: Re: Object#freeze as a basis for caching of method results? --pKvQgaf82iZAytyH Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Robert Klemme: > Demarshalling was the option I had thought of. A copy through > marshalling _might_ use less memory than the marshaled form > (the String). Right, but then I=E2=80=99m back to defining a sensible #=3D=3D, #eql? and #hash for the class in question. On the other hand, with serialization I=E2=80=99m just silently handing ove= r the decision to Marshal, so I might as well (from the logical point of view, barring the resource overhead) assume they=E2=80=99re defined as def =3D=3D other Marshal.dump(self) =3D=3D Marshal.dump(other) end def eql? Marshal.dump(self).eql? Marshal.dump(other) end def hash Marshal.dump(self).hash end Hmmm. :) I=E2=80=99ll go with using the Marshal strings as keys and see how expensive it turns out to be. Thanks a lot again, Robert! -- Shot --=20 A database is a black hole into which you put your data. If you're lucky, you'll get it back again. If you're very lucky, you'll get it back in a form you can use. -- Charlie Gibbs --pKvQgaf82iZAytyH Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFHvb8ki/mCfdEo8UoRApUkAJ44H83ciqQyqbH/N4rXilArbjfz6QCfT2sX HbmOtl/0lySNkNZiS5v1qEo= =DZ4k -----END PGP SIGNATURE----- --pKvQgaf82iZAytyH--