On Thu, 30 May 2013 08:25:55 +0600, Robert Bradshaw <rober...@gmail.com>
wrote:
On Sun, May 26, 2013 at 10:04 AM, Nikita Nemkin <nik...@nemkin.ru> wrote:
Hi,
I wonder why is __pyx_filename (in exception check blocks)
tracked dynamically? AFAIK it's impossible to split function
body between multiple files (include only works at the top level),
which makes filename a compile time constant for any given function.
If the above is correct, __pyx_filename variable can be eliminated,
saving at least 5 bytes per exception check (more on x64).
Probably because exception checks are heavy-weight enough that we
haven't bothered optimizing them at this level yet.
By "exception checks" I mean these things:
if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15;
__pyx_clineno = __LINE__; goto __pyx_L1_error;}
They are fast, but the problem is the extra code: neither
__pyx_filename nor __pyx_clineno assignments are necessary.
Removing them reduces binary size by 2-3%.
If you're OK with it, I'll make a patch that removes __pyx_filename
and disables __pyx_clineno by default.
Best regards,
Nikita Nemkin
_______________________________________________
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel