[ZODB-Dev] [Performance] excessive time in "Connection.afterCompletion"

Tim Peters tim.peters at gmail.com
Fri Mar 31 18:48:05 EST 2006


[Dieter Maurer]
> We are currently tuning an application for performance and therefore
> perform intensive profiling. To our surprise, it turned out
> that about 15% of total request time was spent in
> "Connection.afterCompletion". "Connection.afterCompletion" is mapped
> to "Connection._storage_sync" which in our case called the
> "ZEO.ClientStorage"'s "sync" method (and this caused the excessive
> time).
>
>
> What is the motivation to request synchronized transaction completion
> by default?

Primarily so we could stop seeing endless threads on zodb-dev asking
why ZEO clients that didn't happen to modify any objects never saw
current data.  From the NEWS file:

- (3.4a6) Relatedly, ``Connection`` implements ``ISynchronizer``, and
  ``Connection``'s ``afterCompletion()`` and ``newTransaction()`` methods now
  call ``sync()`` on the underlying storage (if the underlying storage has
  such a method), in addition to processing invalidations.  The practical
  implication is that storage synchronization will be done automatically now,
  whenever a transaction is explicitly started, and after top-level
  transaction commit or abort.  As a result, ``Connection.sync()`` should
  virtually never be needed anymore, and will eventually be deprecated.


More information about the ZODB-Dev mailing list