[Python-Dev] Strange import behaviour, recently introduced

Jack Jansen jack@oratrix.nl
Wed, 21 Feb 2001 16:06:34 +0100


I'm running into strange problems with import in frozen Mac programs.

On the Mac a program is frozen in a rather different way from how it happens 
on Unix/Windows: basically all .pyc files are stuffed into resources, and if 
the import code comes across a file on sys.path it will look for PYC resources 
in that file. So, you freeze a program by stuffing all your modules into the 
interpreter executable as PYC resources and setting sys.path to contain only 
the executable file, basically.

This week I noticed that these resource imports have suddenly become very very 
slow. Whereas startup time of my application used to be around 2 seconds 
(where the non-frozen version took 6 seconds) it now takes almost 20 times as 
long. The non-frozen version still takes 6 seconds.

I suspect this may have something to do with recent mods to the import code, 
but attempts to pinpoint the problem have failed so far (somehow the profiler 
crashes my app). I've put a breakpoint at import.c:check_case(), and it isn't 
hit (as is to be expected), so that isn't the problem.

Does anyone have a hint for where I could start looking?
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | ++++ see http://www.xs4all.nl/~tank/ ++++