Author methane
Recipients Mark.Shannon, methane, serhiy.storchaka
Date 2020-10-31.13:08:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>

> Do you mean sharing values of co_code and co_lnotab between code objects of the same module?


> How much memory does this save (in absolute and relative value)?

Maybe 1~3%, but I am not sure. I am more interested in reducing number of objects, because it will reduce import time.
Additionally, co_code is used while executing code. Unlike other cold data (e.g. docstring, annotations), sharing co_code will improve CPU cache utilization.

> Which functions have the same co_code?

For example,

# logging/

    def manager(self):
        return self.logger.manager
    def name(self):

Such simple functions are very common in OO-style code.

@Mark Shannon

Date User Action Args
2020-10-31 13:08:27methanesetrecipients: + methane, Mark.Shannon, serhiy.storchaka
2020-10-31 13:08:27methanesetmessageid: <>
2020-10-31 13:08:27methanelinkissue42217 messages
2020-10-31 13:08:27methanecreate