Serhiy Storchaka added the comment:

> Padding makes it both less efficient and more annoying to handle, IMO.

Agree. But there is other application for NOPs. UTF-8 decoder (and some other 
decoders) works more fast (up to 4x) when input is aligned. By adding several 
NOPs before BINUNICODE so that start of encoded data is 4- or 8-bytes aligned 
relatively to start of frame, we can significan speedup unpickling long ASCII 
strings. I propose to add new NOP opcode and to use it to align some 
align-sensitive data.

> My framing proof-of-concept ends up quite simple in terms of code
> complexity. For example, the C version only adds 125 lines of code in 3
> additional functions.

I just looked in the code and saw that the unpickler already has a ready 
infrastructure for prefetching. Now your words have not appear to be so 
incredible. ;) It should work.

> No doublecopying is necessary (not in the C version, that is).

Agree, there is no doublecopying (except for large bytes objects).

----------

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

Reply via email to