Olivier Grisel <olivier.gri...@ensta.org> added the comment:

Alright, I found the source of my refcounting bug. I updated the PR to include 
the C version of the dump for PyBytes.

I ran Serhiy's microbenchmarks on the C version and I could not detect any 
overhead on small bytes objects while I get a ~20x speedup (and no-memory copy) 
on large bytes objects as expected.

I would like to update the `write_utf8` function but I would need to find a way 
to wrap `const char* data` as a PyBytes instance without making a memory copy 
to be able to pass it to my `_Pickle_write_large_bytes`. I browsed the C-API 
documentation but I could not understand how to do that.

Also I would appreciate any feedback on the code style or things that could be 
improved in my PR.

----------

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

Reply via email to