[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

Serhiy Storchaka report at bugs.python.org
Thu Feb 2 07:43:13 EST 2017


Serhiy Storchaka added the comment:

> So yeah, the "side effect" is that struct.pack("i", 1) becomes 1.56x faster
> (-36%). Ok, maybe it was my main goal ;-) I also mentioned the "new" (?)
> contiguous requirement on buffers.

struct.pack() always was faster than int.to_bytes(). I wanted to speed up 
int.to_bytes(), and after converting to Argument Clinic in issue20185 it have 
became faster than struct.pack(). But after converting the struct module to 
Argument Clinic struct.pack() is faster than int.to_bytes() again! Now I need 
to find other ways to make int.to_bytes() even faster to win this chase.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29300>
_______________________________________


More information about the Python-bugs-list mailing list