Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Static initializers in C++ - sometime ago I saw savings of some 400 ms (?) startup cost of initializing static strings from constants by moving it to some compile time thing.


Right; the issue is that this isn't happening at compile time in Python, because it's not getting compiled ahead-of-time. The equivalent would be if header files had imperative code that got executed at runtime in places where they're included.

(To preempt potential pedantry: yes, I know that you can compile Python to bytecode ahead of time, but that's not really relevant to what's being discussed here because it doesn't mean "the stuff happening in modules I import isn't happening at runtime anymore")


> the issue is that this isn't happening at compile time in Python, because it's not getting compiled ahead-of-time

What are those .pyc files for?


That was the pedantry that they were trying to preempt.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: