note 113431 deleted from function.die by salathe
| From: | salathe@php.net | Date: | Thu, 19 Mar 2015 10:46:31 +0000 |
| Subject: | note 113431 deleted from function.die by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-201982@lists.php.net to get a copy of this message | ||
Note Submitter: Thomas Horsten
----
Because die() still allows destructors to be read, after analyzing a huge dataset (more than 12GB)
in RAM, and printing the results, it was taking forever to exit while cleaning up (almost a minute),
time that could have been spent running the next dataset. I noticed that killing the process solved
this, but I needed to do it automatically from inside the script to do batch jobs. Saved me hours
when I found out how. There should be an option to quit without wasting time on destructors. Anyway:
posix_kill(getmypid(), SIGTERM);