[Buildbot-commits] [Buildbot] #2246: buildbot.status.builder.BuilderStatus uses slow LRU implementation

Buildbot nobody at buildbot.net
Fri Mar 16 18:51:04 UTC 2012


#2246: buildbot.status.builder.BuilderStatus uses slow LRU implementation
---------------------+------------------------
Reporter:  szager    |       Owner:
    Type:  defect    |      Status:  new
Priority:  critical  |   Milestone:  undecided
 Version:  0.8.6     |  Resolution:
Keywords:            |
---------------------+------------------------

Comment (by szager):

 After looking at this a bit more carefully, I'm not sure that
 AsyncLRUCache is the right way to go.

 Looking at the call counts in my profiling data, this change would
 cause an increase in the number of defer.Deferred callback sequences
 by approximately a factor of 10.

 That's no mistake: BuilderStatus.touchBuildCache() is called several
 hundred times per second, about ten times more frequently than
 defer.Deferred.callback().  I'm wary of blithely adding that amount of
 complexity to a method called so frequently.

 From what I can tell, the AsyncLRUCache implementation uses Deferred's
 primarily to
 accomodate concurrent access to the cache.  That's probably overkill
 for this purpose (after all, the existing implementation of
 BuilderStatus.touchBuildCache has no such protection).  I think a
 better approach will be to use the basic LRU logic from AsyncLRUCache
 (which looks pretty sound), minus the concurrency protections.

 Please let me know if that sounds reasonable.  I'm going to cook up an
 implementation to use for our project (we are in dire straits right now),
 and I can report back on the outcome.

 Thanks,

 Stefan

-- 
Ticket URL: <http://trac.buildbot.net/ticket/2246#comment:2>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the Commits mailing list