Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce number of calls to process_vm_readv() #158

Open
sj-i opened this issue Feb 9, 2022 · 0 comments
Open

Reduce number of calls to process_vm_readv() #158

sj-i opened this issue Feb 9, 2022 · 0 comments

Comments

@sj-i
Copy link
Member

sj-i commented Feb 9, 2022

I have noticed that the number of dereferences to obtain the data needed for trace output from each zend_execute_data is almost the same in each time, and their contents are independent.

After traversing the chain of zend_execute_data, all zend_function_entry and oplines are retrievable with a single call to process_vm_readv(). And from there, all zend_strings for all function names and file names and all pointers to zend_class_entry are also retrievable in a single call to process_vm_readv(). Then all zend_string for all class names in a single call to process_vm_readv().

This should significantly reduce the number of system calls in situations such as Laravel applications where the depth of the calls exceeds 60.

The total amount of memory copy will not change, but it is worth a try.

Perhaps the same optimization can be done for adsr/phpspy#17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant