Google App Engine will put instances to sleep in the Standard Environment, and boot them back up once a new request comes in. I am wondering if my Go code will be compiled again once the instance wakes up or if the compiled code is cached.
If the compiled code is cached, then using the compiler to count the size of an array shouldn't have any impact on the boot time for an instance right?
For instance, would
myCompilerCountedArray := [...]string{"1","2","3"}
and
myUserCountedArray := [3]string{"1","2","3"}
have the same performance when an instance is started after going to sleep?
The code is compiled only once, when you deploy the app.
Quote from the The App Engine Standard Environment doc:
Your app is automatically re-built on the server side whenever you upload new code, and if you are running the local development server the SDK automatically recompiles sources on-the-fly when you change them.
Also, the Go Runtime Environment doc states:
And—as with the Python SDK—your app will be automatically re-built whenever you change the source.
When an instance is started, app engine only loads and runs the executable binary. This fact doesn't seem to be mentioned in the documentation, but it's indicated by the following known issue:
Request failed because the app binary was missing