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

event->trigger() speed profile #10196

Closed
zdanozdan opened this issue Sep 5, 2021 · 3 comments
Closed

event->trigger() speed profile #10196

zdanozdan opened this issue Sep 5, 2021 · 3 comments
Labels
3.0.x.x Affects the 3.0.x.x maintenance version

Comments

@zdanozdan
Copy link

What version of OpenCart are you reporting this for?
3+

Describe the bug
event->trigger() speed issue

system/engine
event->trigger() on profiler looks bad. It takes almost 30% of processing time on aggregate. There is foreach loop called zillion times, basically for every 2x model/view/controller/language. I changed this to simple array key access which improved processing times by factor of 2. Worth to take a look at it

Expected behavior
Use array access. Wildcard events needs to be redesigned though.

Screenshots / Screen recordings
If applicable, add screenshots or recordings to help explain your problem. Please keep these short and if you can, edit them to point out when/where the problem is.
https://www.useloom.com/ is perfect for screen recording with Chrome or with their desktop app

Zrzut ekranu 2021-09-5 o 22 53 57

@WebkulOpencart WebkulOpencart added the 3.0.x.x Affects the 3.0.x.x maintenance version label Sep 6, 2021
@TheCartpenter
Copy link
Contributor

I covered similar subject long ago on this repository that new instances should not be loaded in a loop since it can normally load up a maximum of 300 classes overall during the loop. Events can get pretty vast, and rapidly, with time.

@zdanozdan
Copy link
Author

I guess events can be real killer as processing time rise exponential in relation to number of events. The fix is fairly easy but wildcards are real pain to solve.

@danielkerr
Copy link
Member

closing issue.

will look into later if people report problems once the extensions using events are in full swing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0.x.x Affects the 3.0.x.x maintenance version
Projects
None yet
Development

No branches or pull requests

4 participants