mpb added the comment:

It would be nice in terms of avoiding malloc()s and free()s.

I could estimate it in terms of memoryview creations per message parse.  I'll 
be creating 10-20 memoryviews to parse each ~100 byte message.

So... I guess I'd have to build a test to see how long a memoryview 
creation/free takes.  And then perhaps compare it with variable to variable 
assignment instead.

If Python pools and recycles unused object by type (the way Lisp recycles cons 
cells) without free()ing them back to the heap, then there would be minimal 
speed improvement from my suggestion.  I don't know how CPython works 
internally, however.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19577>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to