[Buildbot-commits] [Buildbot] #2246: buildbot.status.builder.BuilderStatus uses slow LRU implementation
Buildbot
nobody at buildbot.net
Sun Mar 18 05:23:14 UTC 2012
#2246: buildbot.status.builder.BuilderStatus uses slow LRU implementation
------------------------+--------------------
Reporter: szager | Owner:
Type: defect | Status: new
Priority: critical | Milestone: 0.8.7
Version: 0.8.6 | Resolution:
Keywords: performance |
------------------------+--------------------
Comment (by dustin):
I don't see any difference between the nested `ref_key` function in
AsyncLRUCache and the `_ref_key` method in your patch. Using a method
incurs some overhead, too.
Even just the get method here is a lot of duplicate code, which makes good
sense from the perspective of an external patch, but not much sense for
something merged to Buildbot.
If you could factor this out into an `LRUBase` class with two subclasses
for sync and async interfaces, that might be best. Then the first half of
`get` could be factored into something like `_get_hits` (including the
nested `ref_key` function), which is called from both the sync and async
`get` methods.
Thanks for keeping to the Buildbot style in `lru.py`. As for the new test
script, it uses 2-space indents in the second half, so that should be
fixed up before being submitted as a pull request.
All in all, I think this is a great improvement, so please do take the
time to make these changes -- then when you do upgrade to 0.8.7 or higher,
you won't have to reapply this patch!
In general, I'll be interested to know of any other performance
improvements you uncover in Buildbot. [tag:performance The performance
tag] lists some other relevant bugs.
--
Ticket URL: <http://trac.buildbot.net/ticket/2246#comment:6>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation
More information about the Commits
mailing list