Robert Bradshaw, 18.12.2009 00:24:
> On Dec 17, 2009, at 2:28 PM, Lisandro Dalcín wrote:
>> On Thu, Dec 17, 2009 at 3:48 PM, Stefan Behnel wrote:
>>
>>> No need to silence a warning that we generate ourselves.
>> Unless the warning is pointless, as in this very specific use case.

I actually meant that it would be easier to drop the warning altogether
than to try to silence it using the warnings module.


> This could also happen with a system install, where the first person  
> to run Cython doesn't have the required permissions to write the pickle.

Then that's a good reason to actually remove the warning. If pickling
fails, fine.


>> PS: It could seem that I'm worrying too much about this, but I want
>> this feature to function really well. This is really nice way to
>> easily "upgrade"/"downgrade" your Cython version for building specific
>> projects... This is going to be important if Cython ever gets its way
>> to Python's stdlib. It is also important if you are using some Linux
>> distro where Cython-0.11 is in the system install, but you need to
>> build the -dev copy of some Cython-based project that requires 0.12...
>> Then a user can download the big 4.3MB Cython-0.12.zip (or a lite,
>> striped version with 290KB like the one I'm trying to do) and get the
>> -dev code cythonized.
> 
> I think this is a worthy usecase.

Note that zip files don't support binaries, though. So a Cython version
running from a zip file will be substantially slower than one that is
properly installed with a compiled parser.

Setuptools has some fake support for .so/.dll files in zip files, but it
basically just copies them out of the zip and into a temporary directory to
load them from there. I find that rather unintuitive and ugly behaviour.


>> Creating lexicon...
>> Done (0.08 seconds)
> 
> Another data point:
> 
> $ touch empty.pyx
> $ time python cython.py empty.pyx
> Creating lexicon...
> Done (0.04 seconds)
> Pickling lexicon...
> Done (0.01 seconds)
> 
> real  0m0.353s
> user  0m0.279s
> sys   0m0.071s
> 
> cython-devel$ time python cython.py empty.pyx
> 
> real  0m0.321s
> user  0m0.243s
> sys   0m0.073s
> 
> Really, that's hardly any savings at all. Maybe at one point this was  
> really expensive? In any case, I think it might make more sense to  
> generate the pickle at install time (with a possible error), and  
> silently ignore failed re-creating attempts otherwise.

Or just drop the pickling completely, as Greg suggested.

Stefan

_______________________________________________
Cython-dev mailing list
Cython-dev@codespeak.net
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to