# gprof & PHP

- Thread: https://externals.io/message/37476
- Original archive: https://news-web.php.net/php.internals/37476
- Started by George Wang on 2008-05-05T18:41:34+00:00
- Messages: 4
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #37476 — George Wang — 2008-05-05T18:41:34+00:00

URL: https://externals.io/message/37476#37476

Hi,

Seems that PHP engine is using ITIMER_PROF and `SIGPROF` for limiting the 
max execution time of a php script, and gprof cannot produce useful 
results.
Is there an option to turn it off temporarily? Is there a better tool 
for code optimization?

Thanks,
George

---

## #37478 — Stanislav Malyshev — 2008-05-05T18:47:13+00:00

URL: https://externals.io/message/37476#37478 · In reply to: #37476

Hi!

> Seems that PHP engine is using ITIMER_PROF and `SIGPROF` for limiting the 
> max execution time of a php script, and gprof cannot produce useful 
> results.
> Is there an option to turn it off temporarily? Is there a better tool 
> for code optimization?

IIRC if "max_execution_time" is 0 then timeout should not be set.
-- 
Stanislav Malyshev, Zend Software Architect
stas@zend.com   http://www.zend.com/
(408)253-8829   MSN: stas@zend.com

---

## #37481 — George Wang — 2008-05-05T19:12:28+00:00

URL: https://externals.io/message/37476#37481 · In reply to: #37478

> > […]
>
> IIRC if "max_execution_time" is 0 then timeout should not be set.
It helps a little after I set both "max_execution_time" and 
"max_input_time" to 0, PHP engine no longer set ITIMER_PROF and `SIGPROF` 
at the beginning of the request.
However, at the end of the request, PHP engine still set ITIMER_PROF to 
0 regardless. I guess I have to patch the code.

Thanks,
George

---

## #37487 — Marcus Boerger — 2008-05-05T19:40:54+00:00

URL: https://externals.io/message/37476#37487 · In reply to: #37481

Hello George,

  sounds like you found a bug to me. We somehow need to have a request
variale that tracks whetehr the signal handling was activated. Since the
user could change the ini settings during the script, we either need to
disallow that (in case we don't yet) and can use the same checks as for the
start or we need a completely new variable.

marcus

Monday, May 5, 2008, 9:12:28 PM, you wrote:


> > […]
> It helps a little after I set both "max_execution_time" and 
> "max_input_time" to 0, PHP engine no longer set ITIMER_PROF and `SIGPROF` 
> at the beginning of the request.
> However, at the end of the request, PHP engine still set ITIMER_PROF to 
> 0 regardless. I guess I have to patch the code.

> Thanks,
> George





Best regards,
 Marcus
