Store.flush() includes a loop that is O(# alive objects)

Bug #241267 reported by James Henstridge
2
Affects Status Importance Assigned to Milestone
Storm
Fix Released
High
Thomas Herve

Bug Description

In general, the cost of Store.flush() should be proportional to the number of dirty objects. However there is a loop at the start that is proportional to the number of alive objects:

        for obj_info in self._iter_alive():
            obj_info.event.emit("flush")

As the number of referenced objects grows, the cost of flush() increases irrespective of how many are dirty.

The flush event is only needed for objects that have column properties with mutable values like List() or Pickle() (in contrast to immutable values like strings and integers). If no such objects are in use, then the loop and events serve no purpose.

The cost of the flush events should only be incurred if objects that require it are used.

Related branches

Changed in storm:
importance: Undecided → High
Revision history for this message
James Henstridge (jamesh) wrote :

Thomas's branch merged as r269 fixes this problem.

Changed in storm:
assignee: nobody → therve
status: New → Fix Committed
Thomas Herve (therve)
Changed in storm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.