Re: Unique string storage (was Re: Why don't stringobjects have methods?)

Jim Roskind (
Mon, 4 Apr 1994 14:02:38 +0800

> Date: Mon, 04 Apr 94 15:42:13 -0400
> From: Tim Peters <>
> [ discussion of unique-ifyng strings]
> Whether that's a win overall depends on how often string (in)equality
> testing is done, compared to how often strings are created. I don't
> know, but suspect that _most_ programs have an unfavorable ratio.

I can think of one scenario where this change would be a *big* loss.
If you try to build up strings by concatenation, then the intermediate
values would have to be "unique-ified." I think that it would be very
painful (in terms of CPU utilization) to do this unique-ification on
temporaries, only to throw them away in a moment.

Bottom line: sometimes you want it, sometimes you don't. IMHO, it
would be "bad" to always force unique-ification.

Status quo in this area was probably (MHO) a very good decision on the
language designer's part.


Jim Roskind