Skip to content

Commit c1998a0

Browse files
committed
Fixed python 3 performance regression
It makes the difference between tests in 110s, or 11s
1 parent 84929ed commit c1998a0

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

doc/source/changes.rst

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Changelog
33
#########
44

5+
**********
6+
v0.8.4
7+
**********
8+
- Fixed Python 3 performance regression
9+
510
**********
611
v0.8.3
712
**********

smmap/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
__author__ = "Sebastian Thiel"
44
__contact__ = "[email protected]"
55
__homepage__ = "https://github.com/Byron/smmap"
6-
version_info = (0, 8, 3)
6+
version_info = (0, 8, 4)
77
__version__ = '.'.join(str(i) for i in version_info)
88

99
# make everything available in root package for convenience

smmap/util.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
except NameError:
2424
# Python 3 has no `buffer`; only `memoryview`
2525
def buffer(obj, offset, size):
26-
# return memoryview(obj)[offset:offset+size]
26+
# Actually, for gitpython this is fastest ... .
27+
return memoryview(obj)[offset:offset+size]
2728
# doing it directly is much faster !
28-
return obj[offset:offset + size]
29+
# return obj[offset:offset + size]
2930

3031

3132
def string_types():

0 commit comments

Comments
 (0)