A couple comments (which may get corrected by the experts):
Please indicate why this post is abusive, and provide any other useful
information.
1.
def modify_headers(self,handle_a,ctx_a,add={},delete=[],replace={}):
If you can add types to add, delete, and replace (dict and list), that
will speed some things up.
21.
for i,hdr_n in enumerate(delete):
22.
ii=i
You should type your indices above as type int or size_t. Also, it
would be faster to do
for i from 0 <= i < len(delete):
hdr_n = delete[i]
as this avoids the overhead of creating and unpacking tuples and
converting one to an index. If this solves your problem, then there's
probably in error somewhere.
29.
for i,(hdr_n,hdr_v) in enumerate(add.items()):
In this case, it would be faster, if you aren't changing add and it's
ad dict, to do
i = 0
for hdr_n, hdr_v in add.iteritems():
# other code
i += 1
--
++++++++++++++++++++++++++++++++++++++++++++++++
+ Hoyt Koepke
+ University of Washington Department of Statistics
+ http://www.stat.washington.edu/~hoytak/
+ [email protected]
++++++++++++++++++++++++++++++++++++++++++
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev