From: Aaron Patterson Date: 2011-03-02T10:38:01+09:00 Subject: [ruby-core:35409] Re: Why are hash keys sometimes duped? --wac7ysb48OaltWcw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 02, 2011 at 09:04:44AM +0900, Yukihiro Matsumoto wrote: > Hi, >=20 > Eric, your guess is correct. It's a compromise between mutable > strings and rehashing. This makes me wonder, is rehashing more expensive than allocating a new string? Are string mutations so common that allocating a new string object is cheaper? It seems there must be a point where extra time spent in GC and extra time spent allocating strings would overcome the cost of rehashing. I guess I'd better study st.c more closely. --=20 Aaron Patterson http://tenderlovemaking.com/ --wac7ysb48OaltWcw Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iQEcBAEBAgAGBQJNbZ3ZAAoJEJUxcLy0/6/GEWsH/0VU8Y/SAanhgK8fizd7ySNe ozhadZ/aQBTgdPE1cQtlayZxy78I4yzzxoGH/ws6paZVaVtUB/PHZ7kQSAUl7GOz voz9CO36Ng/ZLIgVDFVBgOYYhsdt4BA5171aD/65qjwU8dwAfZX4QRrXoP0AdKtS uOxabLsX/k1n+qzbmS57wVnxITXGf1uGoyzvukbhKy3Kc4NbrQdXoeAO//NbvvuH eYwU+8oVbZbmqZHOk+ETs0jACC6pySygXstdPkKi24b95P3Fv2SHyIjPIj5+BP92 9HxCt7bLxbIHRLrz7soNfsbNKEk9rahel0iKPJ7ru8dWc4jyYOmQoEWPz2LWo1c= =k5dz -----END PGP SIGNATURE----- --wac7ysb48OaltWcw--