[Python-checkins] CVS: python/dist/src/Python ceval.c,2.287,2.288

Jeremy Hylton jeremy@zope.com
Wed, 7 Nov 2001 15:02:19 -0500 (EST)


>>>>> "MAL" == M -A Lemburg <lemburg@users.sourceforge.net> writes:

  MAL> Update of /cvsroot/python/python/dist/src/Python In directory
  MAL> usw-pr-cvs1:/tmp/cvs-serv19062/Python

  MAL> Modified Files:
  MAL> 	ceval.c
  MAL> Log Message: Add fast-path for comparing interned (true) string
  MAL> objects.

  MAL> This patch boosts performance for comparing identical string
  MAL> object by some 20% on my machine while not causing any
  MAL> noticable slow-down for other operations (according to tests
  MAL> done with pybench).

Hey!  Don't do that.

The last time this came up, I thought there was a pretty clear
conclusion that we did not want to make thise change.  The tests done
with pybench are empirical observations, but they don't disprove the
theory that this change does slowdown comparisons of other objects.

The last discussion we had on this subject was this message:

---------------------------------------------------------------

From: "Tim Peters" <tim.one@home.com>
To: <python-dev@python.org>
Subject: RE: [Python-Dev] Slices and "==" optimization
Date: Thu, 1 Nov 2001 02:42:39 -0500

Before we special-case strings more, we should fix what we've got:  Martin
(IIRC) inserted a fast path at the start of do_richcmp early in the 2.2
cycle:

---------------------------------------------------------------

Did anyone try to fix what we already have?  I'd like to see what the
effect of that is.

Jeremy