Author barry
Recipients barry, brett.cannon, christian.heimes, gvanrossum, lukasz.langa, methane, rhettinger, serhiy.storchaka, terry.reedy, vstinner
Date 2017-11-02.21:27:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I like this a lot and while the issue is still open, I'm piggybacking my PR 4240 on this one.

I have a use case for enabling this feature via environment variable, so PR 4240 adds PYTHONPROFILEIMPORTTIME which also enables this feature.

We build our tools using pex, which hardcodes the shebang at the top of the zip file.  This isn't easily changed, and clearly we wouldn't want to enable -X importtime everywhere.  When we have startup performance issues, I want to be able to tell people (or set it up in our CI) to set the environment variable and collect the data for analysis.  This is much easier than tweaking the shebang or invoking the zip with an explicit command.  Also, there are potential gotchas with loading too much up on the shebang line (IIRC, there are line length limits and/or multiple option limits for shebangs, e.g. if we wanted to have both -I and -X).

I haven't fixed the initialization check problem that serhiy.storchaka points out, since that's addressed by PR 4138.  But maybe I should fold that change into mine.
Date User Action Args
2017-11-02 21:27:53barrysetrecipients: + barry, gvanrossum, brett.cannon, rhettinger, terry.reedy, vstinner, christian.heimes, methane, lukasz.langa, serhiy.storchaka
2017-11-02 21:27:52barrysetmessageid: <>
2017-11-02 21:27:52barrylinkissue31415 messages
2017-11-02 21:27:52barrycreate