#12439 change parts that may be affecting the benchmark#12446
#12439 change parts that may be affecting the benchmark#12446allrob23 wants to merge 6 commits intotwisted:trunkfrom
Conversation
CodSpeed Performance ReportMerging #12446 will degrade performances by 98.96%Comparing Summary
Benchmarks breakdown
|
|
please review |
glyph
left a comment
There was a problem hiding this comment.
Updating in the hopes that this will pass the static checks, but can you have a look and just try to push something which gets the green checkmark?
|
@allrob23 It looks like the only issue here is that you forgot to file an issue describing the problem first and adding a news fragment. The fragment itself could be a |
|
@glyph maybe in some cases we can use the PR id instead of the issue id... to reduce the red tape I understand that we have an issue, and that issue might not be fixed with the first proposed PR... but if this PR is not merged, the newsfragment is also not merged Just trying to make it easier for people to contribute |
I think that writing down the issue that you plan to fix before writing any code is a really good habit that I wish felt less like "red tape". But, given that we seem to be going against the grain, perhaps in the case where we would accept a |
I fully agree with creating a news fragment file for every PR. The question is about creating a GitHub Issue, when you already have a Github PR with a description of the "problem" |
|
Hello @adiroiban and @glyph , surry but after your conversation I don't quite understand what I need to do, do I need to create the Issue? Is there something else I should do? |
Adi already created the news fragment for you, so you're all set here as far as that goes. I guess the sticking point right now is that I don't understand the massive benchmark regression here. wouldn't emptying out |
| for obs in observers: | ||
| publisher.addObserver(obs) |
There was a problem hiding this comment.
Wait, this is definitely wrong. go() is the function that the benchmark is running over and over again. This is supposed to be measuring dispatch, i.e. the amount of time that LogPublisher.__call__ takes, not the amount of time addObserver takes.
The setup is excluded from the benchmark measurement on purpose. The benchmark that captures It's possible that we might want to replace |
Scope and purpose
While analyzing the profiler in the codespace, I noticed that the
DummyObserverclass was spending some time processing events, which could influence the benchmark results. Additionally, the benchmark test a test was not adding observers in thegofunction, missing a part of the setup that affects the performance measurement.Changes Made
DummyObserverto remove event storage (last_event) and make__call__a no-op, reducing its impact on the benchmark.test_log_publisher_call_dispatchto explicitly add observers to theLogPublisherinside thegofunction, ensuring the benchmark reflects the realistic setup where observers are added before dispatching events.LogPublisherto start without observers, aligning with the new setup ingo.Related with #12439 and #12440
Contributor Checklist:
This process applies to all pull requests - no matter how small.
Have a look at our developer documentation before submitting your Pull Request.
Below is a non-exhaustive list (as a reminder):
please review.Our bot will trigger the review process, by applying the pending review label
and requesting a review from the Twisted dev team.