Re: [Cython] Size of output

2020-02-01 Thread Robert Bradshaw
On Sat, Feb 1, 2020 at 6:33 AM John Skaller2 wrote: > > > given target. Removing the final 0.5% of code that is "unused in some > > cases" is really not something I would want to invest days into, each time > > we make a change in Cython. > > But its not 0.5%. My problem is trying to read the gene

Re: [Cython] Size of output

2020-02-01 Thread John Skaller2
> On 2 Feb 2020, at 03:06, Prakhar Goel wrote: > > Isn't it? > https://cython.readthedocs.io/en/latest/src/tutorial/cython_tutorial.html#primes: > Jump down to the part where it has "annotate=True" and it describes it > in some detail. > > Also this takes all of thirty-seconds to try out and

Re: [Cython] Size of output

2020-02-01 Thread Prakhar Goel
Isn't it? https://cython.readthedocs.io/en/latest/src/tutorial/cython_tutorial.html#primes: Jump down to the part where it has "annotate=True" and it describes it in some detail. Also this takes all of thirty-seconds to try out and the result is pretty self explanatory. -- ___

Re: [Cython] Size of output

2020-02-01 Thread Nathan
Interesting it’s not documented well, it definitely should be. It corresponds to this compiler option: https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html#Cython.Compiler.Options.annotate When you turn that option on or pass -a or —annotate to the compiler, c

Re: [Cython] Size of output

2020-02-01 Thread John Skaller2
> On 2 Feb 2020, at 02:23, Stefan Behnel wrote: > > John Skaller2 schrieb am 01.02.20 um 15:32: >> My problem is trying to read the generated code. > > You might be looking for "cython -a". OK. I see these: ~/felix>../cython/cython.py usage: cython.py [-h] [-V] [-l] [-I INCLUDE_PATH] [-o OUT

Re: [Cython] Size of output

2020-02-01 Thread Stefan Behnel
John Skaller2 schrieb am 01.02.20 um 15:32: > My problem is trying to read the generated code. You might be looking for "cython -a". Stefan ___ cython-devel mailing list cython-devel@python.org https://mail.python.org/mailman/listinfo/cython-devel

Re: [Cython] Size of output

2020-02-01 Thread John Skaller2
> given target. Removing the final 0.5% of code that is "unused in some > cases" is really not something I would want to invest days into, each time > we make a change in Cython. But its not 0.5%. My problem is trying to read the generated code. A possibility might be an option which puts the bo

Re: [Cython] Size of output

2020-02-01 Thread Stefan Behnel
Robert Bradshaw schrieb am 01.02.20 um 00:49: > Taking a quick glance at an auto-generated file for an empty .pyx, we have > [...] > ~300 lines module setup code. Even for trivial modules, we still > declare and call functions for creating globals, preparing types, etc. > even if we don't have any

Re: [Cython] Size of output

2020-01-31 Thread John Skaller2
> I agree there's some fat that could be trimmed there, but not sure > it'd be worth the effort. You’re probably right. Its a problem writing a compiler in a language wholy unsuited for the job. Even with a more suitable language, emitting code, in the right order, with just the things actually r

Re: [Cython] Size of output

2020-01-31 Thread John Skaller2
> >> Is there an option to use an #include for the standard stuff? > > There are upsides and downsides to that as well. Hence an option. But it could be work to implement so I’m just exploring at the moment. > The way > things are, the generated file is self-contained, and can > be shipped with

Re: [Cython] Size of output

2020-01-31 Thread Robert Bradshaw
On Fri, Jan 31, 2020 at 3:17 PM Greg Ewing wrote: > > On 1/02/20 3:17 am, John Skaller2 wrote: > > When I ran Cython on a two line Python function I got this from wc: > > > > 4276 13798 161338 oldtest.c > > That seems a bit excessive. > > > A lot of the emitted code appeared to be run time

Re: [Cython] Size of output

2020-01-31 Thread Greg Ewing
On 1/02/20 3:17 am, John Skaller2 wrote: When I ran Cython on a two line Python function I got this from wc: 4276 13798 161338 oldtest.c That seems a bit excessive. A lot of the emitted code appeared to be run time and compile time support code which wasn’t actually used. Not sure

[Cython] Size of output

2020-01-31 Thread John Skaller2
When I ran Cython on a two line Python function I got this from wc: 4276 13798 161338 oldtest.c It took a while to actually find the implementation of the function. A lot of the emitted code appeared to be run time and compile time support code which wasn’t actually used. Eliminating stu