Commit Graph

34587 Commits

Author SHA1 Message Date
Fredrik Lundh 6471ee4f18 needforspeed: use "fastsearch" for count and findstring helpers. this
results in a 2.5x speedup on the stringbench count tests, and a 20x (!)
speedup on the stringbench search/find/contains test, compared to 2.5a2.

for more on the algorithm, see:

    http://effbot.org/zone/stringlib.htm

if you get weird results, you can disable the new algoritm by undefining
USE_FAST in Objects/unicodeobject.c.

enjoy /F
2006-05-24 14:28:11 +00:00
Fredrik Lundh 240bf2a8e4 use Py_ssize_t for string indexes (thanks, neal!) 2006-05-24 10:20:36 +00:00
Tim Peters 8ff672e62d Add missing svn:eol-style property to text files. 2006-05-23 21:55:53 +00:00
Tim Peters 211219af4f Whitespace normalization. 2006-05-23 21:54:23 +00:00
Tim Peters 1bddfb84ee test_struct grew weird behavior under regrtest.py -R,
due to a module-level cache.  Clearing the cache should
make it stop showing up in refleak reports.
2006-05-23 21:51:35 +00:00
Fredrik Lundh 7763351808 return 0 on misses, not -1. 2006-05-23 19:47:35 +00:00
Tim Peters f178e5c1b7 Get the Windows build working again (recover from
`struct` module changes).
2006-05-23 19:34:37 +00:00
Andrew M. Kuchling 70bd199fa4 Add item 2006-05-23 19:32:35 +00:00
Bob Ippolito 07c023b10e fix typo in _struct 2006-05-23 19:32:25 +00:00
Bob Ippolito d3611eb3c6 forward declaration for PyStructType 2006-05-23 19:31:23 +00:00
Andrew M. Kuchling 150faff195 Add two items 2006-05-23 19:29:38 +00:00
Bob Ippolito 4de3f998bf fix linking issue, warnings, in struct 2006-05-23 19:25:52 +00:00
Bob Ippolito 232f3c91f9 patch #1493701: performance enhancements for struct module 2006-05-23 19:12:41 +00:00
Bob Ippolito 7ccc95a315 patch #1493701: performance enhancements for struct module 2006-05-23 19:11:34 +00:00
Bob Ippolito 27abce5ba8 revert #1493701 2006-05-23 19:09:51 +00:00
Andrew M. Kuchling 9deeeef092 Remove duplicate item 2006-05-23 19:00:45 +00:00
Bob Ippolito fb8b84af54 Patch #1493701: performance enhancements for struct module. 2006-05-23 18:46:41 +00:00
Tim Peters b713ec2531 Bug #1334662 / patch #1335972: int(string, base) wrong answers.
In rare cases of strings specifying true values near sys.maxint,
and oddball bases (not decimal or a power of 2), int(string, base)
could deliver insane answers.  This repairs all such problems, and
also speeds string->int significantly.  On my box, here are %
speedups for decimal strings of various lengths:

length speedup
------ -------
 1       12.4%
 2       15.7%
 3       20.6%
 4       28.1%
 5       33.2%
 6       37.5%
 7       41.9%
 8       46.3%
 9       51.2%
10       19.5%
11       19.9%
12       23.9%
13       23.7%
14       23.3%
15       24.9%
16       25.3%
17       28.3%
18       27.9%
19       35.7%

Note that the difference between 9 and 10 is the difference between
short and long Python ints on a 32-bit box.  The patch doesn't
actually do anything to speed conversion to long:  the speedup is
due to detecting "unsigned long" overflow more quickly.

This is a bugfix candidate, but it's a non-trivial patch and it
would be painful to separate the "bug fix" from the "speed up" parts.
2006-05-23 18:45:30 +00:00
Fredrik Lundh b63588c188 needforspeed: use append+reverse for rsplit, use "bloom filters" to
speed up splitlines and strip with charsets; etc.  rsplit is now as
fast as split in all our tests (reverse takes no time at all), and
splitlines() is nearly as fast as a plain split("\n") in our tests.
and we're not done yet... ;-)
2006-05-23 18:44:25 +00:00
Bob Ippolito 7298f270a7 Update Misc/NEWS for gzip patch #1281707 2006-05-23 18:43:47 +00:00
Bob Ippolito 82d2558713 Update Misc/NEWS for gzip patch #1281707 2006-05-23 18:41:17 +00:00
Richard Jones a372711fcc fix broken merge 2006-05-23 18:32:11 +00:00
Richard Jones cebbefc98d Applied patch 1337051 by Neal Norwitz, saving 4 ints on frame objects. 2006-05-23 18:28:17 +00:00
Ronald Oussoren 69c347655d An improved script for building the binary distribution on MacOSX. 2006-05-23 15:09:57 +00:00
Andrew M. Kuchling 3e134a5960 Use 'speed' instead of 'performance', because I agree with the argument
at http://zestyping.livejournal.com/193260.html that 'erformance' really means
something more general.
2006-05-23 12:49:35 +00:00
Andrew M. Kuchling 1cdace4294 Mention string improvements 2006-05-23 12:47:01 +00:00
Andrew M. Kuchling c602723e45 Add some items; mention the sprint 2006-05-23 12:44:36 +00:00
Ronald Oussoren b02daf794b Patch #1488098.
This patchs makes it possible to create a universal build on OSX 10.4 and use
the result to build extensions on 10.3. It also makes it possible to override
the '-arch' and '-isysroot' compiler arguments for specific extensions.
2006-05-23 12:01:11 +00:00
Ronald Oussoren 58f8eba372 Disable linking extensions with -lpython2.5 for darwin. This should fix bug
#1487105.
2006-05-23 11:47:16 +00:00
Georg Brandl 658d513328 PyErr_NewException now accepts a tuple of base classes as its
"base" parameter.
2006-05-23 11:17:21 +00:00
Ronald Oussoren da89b99533 Avoid creating a mess when installing a framework for the second time. 2006-05-23 11:04:24 +00:00
Richard Jones 7c88dcc5ab Merge from rjones-funccall branch.
Applied patch zombie-frames-2.diff from sf patch 876206 with updates for
Python 2.5 and also modified to retain the free_list to avoid the 67%
slow-down in pybench recursion test. 5% speed up in function call pybench.
2006-05-23 10:37:38 +00:00
Fredrik Lundh 833bf9422e needforspeed: fixed unicode "in" operator to use same implementation
approach as find/index
2006-05-23 10:12:21 +00:00
Fredrik Lundh 3d885e0195 needforspeed: check first *and* last character before doing a full memcmp 2006-05-23 10:10:57 +00:00
Tim Peters 1bacc641a0 unicode_repeat(): Change type of local to Py_ssize_t,
since that's what it should be.
2006-05-23 05:47:16 +00:00
Tim Peters 286085c781 PyUnicode_Join(): Recent code changes introduced new
compiler warnings on Windows (signed vs unsigned mismatch
in comparisons).  Cleaned that up by switching more locals
to Py_ssize_t.  Simplified overflow checking (it can _be_
simpler because while these things are declared as
Py_ssize_t, then should in fact never be negative).
2006-05-22 19:17:04 +00:00
Fredrik Lundh 8a8e05a2b9 needforspeed: use memcpy for "long" strings; use a better algorithm
for long repeats.
2006-05-22 17:12:58 +00:00
Fredrik Lundh f1d60a5384 needforspeed: speed up unicode repeat, unicode string copy 2006-05-22 16:29:30 +00:00
Bob Ippolito d82c3105cc Apply revised patch for GzipFile.readline performance #1281707 2006-05-22 15:59:12 +00:00
Fredrik Lundh 763b50f9d9 docstring tweaks: count counts non-overlapping substrings, not
total number of occurences
2006-05-22 15:35:12 +00:00
Bob Ippolito b97597316b Revert gzip readline performance patch #1281707 until a more generic performance improvement can be found 2006-05-22 15:22:46 +00:00
Bob Ippolito d72aab5e31 GzipFile.readline performance improvement (~30-40%), patch #1281707 2006-05-22 14:31:24 +00:00
Tim Peters 31a4262d3d Define SIZEOF_{DOUBLE,FLOAT} on Windows. Else
Michael Hudson's nice gimmicks for IEEE special
values (infinities, NaNs) don't work.
2006-05-22 11:29:41 +00:00
Martin v. Löwis a43190bc78 Patch #1492356: Port to Windows CE (patch set 1). 2006-05-22 09:15:18 +00:00
Martin v. Löwis f90347fdbb Patch 1490384: New Icons for the PC build. 2006-05-22 08:48:14 +00:00
George Yoshida 00f6e1905a Apply patch #1492255 from Mike Foord. 2006-05-21 04:40:32 +00:00
George Yoshida c120a6d897 Fix the TeX compile error. 2006-05-21 04:22:59 +00:00
Andrew M. Kuchling 1e9f574a18 Minor edits 2006-05-20 19:25:16 +00:00
George Yoshida b688b6c30a Apply patch #1492147 from Mike Foord. 2006-05-20 18:07:26 +00:00
George Yoshida 5c6a5ecddf - Add 'as' and 'with' as new keywords in 2.5.
- Regenerate keyword lists with reswords.py.
2006-05-20 16:29:14 +00:00