On Mon, Jun 22, 2020 at 5:19 PM Inada Naoki <songofaca...@gmail.com> wrote:
> I think lightweight bytes-like object is better.  My rough idea is:
>
> * New code and pyc format
>   * pyc has "rodata" segment
>     * It can be copied into single memory block, or can be mmapped.
>       * co_code should be aligned at least 2 bytes.
>   * code.co_code can point to memory block in "rodata".
>   * docstring, signature, and lnotab can be lazy load from "rodata".
>     * signature is serialized in JSON like format.
>   * Allow multiple modules in single file
>     * Reduce fileno when using mmap
>     * Merge more constants
>   * New Python object: PyROData.
>     * It is like read-only bytearray.
>       * But body may be mmap-ped, instead of malloc-ed
>     * code objects owns reference of PyROData.
>       * When PyROData is deallocated, it munmap or free "rodata" segment.
>

With exec, it's possible to create a function that doesn't have any
corresponding pyc or module. Would functions and code objects need to
cope with both this style and the current model?

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/52FLX52YF63MG4K76PIHA3PDDPMW53SK/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to