4 ms·
I do remember some perl scripts where I would send a SIGKILL to itself as the last instruction. Cut the total runtime of the script almost in half...
by fhars 7y ago
I do remember some perl scripts where I would send a SIGKILL to itself as the last instruction. Cut the total runtime of the script almost in half...
- jlokier 7y agoHeh. That script could probably have used POSIX::_exit() to get the same speedup without the calling process thinking it crashed. uWSGI, a web application container for Python, Perl and other languages has an option for that: --skip-atexit-teardown The teardown time delay comes from: - Unreferencing objects recursively, therefore tracing all objects. - Calling destructor functions. - Potentially doubling idle memory use due to copy-on-write as all the objects are written to. When a web application server restarts all its child processes, the third item in particular can result in a large spike in memory use.