Does converting an interpreted script to an executable increase speed?
Question: In general I'm curious, does using a utility that converts a non-exe to an exe
increase speed? It's my understanding that they just package the interpreter
inside the exe.

In specific, if you have a python script and use py2exe on it, does the
resulting executable run faster than the .py? My boss seems to have the
assumption it does but I'm not so sure.

Especially when dealing with multiple modules. For example say you have
modules `first.py` and `second.py`. You compile them all to executables. When
they were .py they `second.py` could be called as

    
    
    from second import main
    main()
    

Now that they're executables you have to start a new process, which surely is
slower?

`subproccess.call(["second.exe"], shell=True)`

Do I understand this correctly? Or does `import`ing from another python module
actually start a new instance of the python interpreter or something?

In our case the target platform is always Windows.


Answer: Your boss is misinformed. All py2exe does is package your program into a self-
contained package capable of running without dependencies. It is still the
same bytecode running on the same interpreter (well, whatever one is
packaged).

See [this other answer](http://stackoverflow.com/a/2830413/1798683) for about
all of the "optimization" you can get out of using -o flags.

Also, yes, definitely run some benchmarks to confirm for yourself.

