-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
documentation 📝Improvements or additions to documentationImprovements or additions to documentationenhancement 🎆New feature or requestNew feature or request
Description
I have added some performance benchmarks with various conditions.
Numbers test
The basic test consists of a Numbers class with the property int $number = 0 and the methods get(): int and add(int $number).
The Numbers test will include 4 cases:
- Without Aspects:
- We don't have aspects here, so we emulate them
- Create
xNumbersServiceclasses which act like the aspects - Run the main method of the copies of the
NumbersServiceclasses which modifies theNumbersclassytimes
- With Aspects:
- Clean the cache
- Create
xaspects - Run the main method of the
Numbersclass with the applied aspectsytimes
- With Cached Aspects:
- The same as "With Aspects", but without the boot up time (Generating proxy and woven files) that will be used from the cache
- Production environment:
- The same as "With Cached Aspects", but the cache will not be checked before loading the cached proxy and woven files
Time complexity
- TODO: For later I want to add some kind of formula for time complexity, so it can be measured with possible performance updates to the library.
I created a GitHub workflow performance-tests.yml and also run them locally on my machines. Below in the comments are the results. Comment your results, if you have a workstation or a server for a better comparison.
Inspection
I have tested with Xdebug (Okapi/AOP 1.2.4) where the bottlenecks are and here is what I found:
WovenClassBuilder::buildMethod() / (new Factory)->fromMethodReflection($refMethod)takes some time- In the
MeasurePerformanceTest::measurePerformance / $result = $numbers->get()in the$useAspectsif statement, takes some time (both in the uncached and cached test), this could possible be made better with this issue: Remove JoinPointInjector if possible #53
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentation 📝Improvements or additions to documentationImprovements or additions to documentationenhancement 🎆New feature or requestNew feature or request