[issue5109] array.array constructor very slow when passed an array object.

2011-01-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Reverted backport in r87945. -- versions: -Python 2.7 ___ Python tracker ___ ___ Python-bugs-

[issue5109] array.array constructor very slow when passed an array object.

2011-01-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed to 2.7 in revision 87944. -- stage: commit review -> committed/rejected status: open -> closed ___ Python tracker ___ __

[issue5109] array.array constructor very slow when passed an array object.

2011-01-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed in revision 87942. @Georg: Yes, I ran coverage and all branches are covered. @Meador: I don't think the old len calculation could handle the case of array object in initial. In any case, I don't find the new code much more complicated than t

[issue5109] array.array constructor very slow when passed an array object.

2011-01-11 Thread Georg Brandl
Georg Brandl added the comment: Should be fine to apply. I trust all the different code paths for different types are tested? -- ___ Python tracker ___

[issue5109] array.array constructor very slow when passed an array object.

2011-01-11 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Georg, Is it too late to commit this for 3.2? -- nosy: +georg.brandl ___ Python tracker ___ _

[issue5109] array.array constructor very slow when passed an array object.

2010-09-02 Thread Meador Inge
Meador Inge added the comment: Overall, this patch look reasonable. I tested on py3k and the the tests pass. I also did a few micro-benchmarks to verify the speedup. One question I do have, though, is whether the 'len' calculation modifications are necessary? This looks like an attempt t

[issue5109] array.array constructor very slow when passed an array object.

2010-07-27 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file17157/issue5109.diff ___ Python tracker ___ ___ Python-bugs-list mai

[issue5109] array.array constructor very slow when passed an array object.

2010-07-27 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am replacing issue5109.diff with an updated version (white space only changes). Does anyone object to this change or need more time to review? -- components: +Extension Modules -Library (Lib) resolution: -> accepted stage: patch review -> com

[issue5109] array.array constructor very slow when passed an array object.

2010-06-25 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue5109] array.array constructor very slow when passed an array object.

2010-06-25 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: -> belopolsky nosy: +belopolsky, mark.dickinson -Alexander.Belopolsky ___ Python tracker ___ __

[issue5109] array.array constructor very slow when passed an array object.

2010-04-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Attached patch makes array(t, a) use memcpy when t == a.typecode. The code array_new can probably be refactored to eliminate redundant checks, but with a good C compiler this probably have no performance effect. While refactoring can simplify the code,

[issue5109] array.array constructor very slow when passed an array object.

2009-04-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: When the datatype is the same, memcpy() should be used. -- nosy: +rhettinger priority: -> high ___ Python tracker ___ __

[issue5109] array.array constructor very slow when passed an array object.

2009-02-04 Thread Malcolm Purvis
Malcolm Purvis added the comment: It's true that memcpy won't work when the data type changes, but I would assume (with no evidence to back me up) that the most common case for passing an array into the array's constructor would be when data types are the same. That case would be case to detect

[issue5109] array.array constructor very slow when passed an array object.

2009-01-30 Thread David W. Lambert
David W. Lambert added the comment: memcpy won't work if the data type changes. (possibly signed <-> unsigned same-byte-count works). -- nosy: +LambertDW ___ Python tracker ___

[issue5109] array.array constructor very slow when passed an array object.

2009-01-30 Thread Malcolm Purvis
New submission from Malcolm Purvis : Copying an array.array object via the array constructor is some 100x slower than using slicing or even converting the array to a string and then passing that string to the array constructor. Running the attached program on a 2.2GHz MacBook Pro (OSX 10.5.5, 4G