# Function call speedup (CV applied to functions)

- Thread: https://externals.io/message/26822
- Original archive: https://news-web.php.net/php.internals/26822
- Started by Sara Golemon on 2006-12-06T16:32:22+00:00
- Messages: 1
- 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

---

## #26822 — Sara Golemon — 2006-12-06T16:32:22+00:00

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

> We had very similar idea in the past.
> BTW it is possible to optimize function calls mach more.
> Not only ZEND_DO_FCALL but also ZEND_INIT_FCALL_BY_NAME can be optimized,
> and we can reuse the same cache entries for all op_arrays from the same PHP
> file.
> 
Sure, I went shallow with this first version just to have something to 
discuss, so that general intent was clear.  There's certainly a lot that 
can be done to improve it both from a code-line coverage and in actual 
implementation (for one thing, I got a crash with it a couple days ago 
which I havn't bothered tracking down).

Making the cache per-file (rather than per-scope) would definately be a 
good direction to go (per-execution would unfortunately break opcode 
cache assumptions so we can't go that high), but I couldn't come up with 
a simple/easy way to "track" the current file.  I suppose we could use 
the op_array's filename attribute to lookup a cache vector from a 
hashtable anytime scope changes...

> I'll make a patch and send it to you in fey days.
> 

Can't wait to see it! :)

-Sara
