Here's one that passes all the tests, and is 2x as fast as the 'current'
and 'new' implementations on random binary data. I haven't been able to
generate data where the 'mike' version is slower:
def read_to_boundary(self, req, boundary, file, readBlockSize=65536):
prevline =
Thanks for that improvement, don't like its complexity though. I'm
testing mikes version with my set of files I will all let you know
how it goes.
BTW, the line that reads last_bound = boundary + '--' so we save 4
CPU cycles there :)
The next test that I will run this against will be
Inspired by Mike's changes I made some changes the new version to
improve performance while keeping readability:
def read_to_boundary_new(self, req, boundary, file, readBlockSize):
previous_delimiter = ''
bound_length = len(boundary)
while 1:
line =
LF character
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
psp_parser: replaces \n on \n
LF character
-
Key: MODPYTHON-87
URL: http://issues.apache.org/jira/browse/MODPYTHON-87
Project: