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

profile better how this module work #90

Open
lekoala opened this issue Jun 25, 2023 · 0 comments
Open

profile better how this module work #90

lekoala opened this issue Jun 25, 2023 · 0 comments

Comments

@lekoala
Copy link
Contributor

lekoala commented Jun 25, 2023

maybe this is a bias introduced by the profiling tool (using xdebug is just slow as hell), but from what i can see, the config api takes a big part from a request

sorting by total self cost, this is what i get for the top functions

image

this is when there is no write. when the config is being written, we have this : 23k calls to the var export function. that doesn't seem right, how can a function be called that much??

image

i think it's probably easy to get at least 10ms per request by improving this component

A couple of things to investigate:

  • Priority::mergeArray could pass argument as reference to optimize performance
  • Not sure why MemoryConfigCollection::get is slow. i'm wondering if checking deprecation at runtime is a good idea for a function called that often
  • getClassConfig seems to cache everything alright. maybe the nested array has some hidden cost. trying a cache key with $classKey_$excludeMiddleware should most likely be more performant (not by much, but that thing is called so much that every gain is interesting ;-) )
  • For config::inst() probably doing $this->manifests[count($this->manifests) - 1]; count each time is not great. since there is strict control over push/pop of manifest, it would be much better to return the latest manifest directly without doing a count call. again, small optimization, but this is called a lot.

:-) that's just some ideas i get by reading the code, maybe none of this matter but I can give it a try

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

No branches or pull requests

2 participants