first time access for Python NumPy
Hello,
script using the numpy. Python 3.8 is first run, it is processed for about 25 seconds with for a simple algorithm to follow.
Subsequent runs of the script are processed for about 2-5 seconds.
Is it possible to speed up the FIRST response of the Python script? It feels like this is related to the operation of "numpy", maybe it is loaded into memory, maybe it can be left in memory, or set the library differently than it is now. Is there anything to recommend here or is that not enough to understand the problem?
-
If I had to guess, the reason it is running faster on subsequent runs is likely related to the automatic run of py_compile. You could perhaps try to "force" the py compile before running the script the first time and see if that resolves your problem. See the upstream documentation about py_compile for more information: https://docs.python.org/3/library/py_compile.html
2
Please sign in to leave a comment.
Comments
1 comment