[issue20826] Faster implementation to collapse consecutive ip-networks
Michel Albert
report at bugs.python.org
Sun Mar 2 15:39:00 CET 2014
New submission from Michel Albert:
This alternative implementation runs over the ``addresses`` collection only once, and "backtracks" only if necessary. Inspired by a "shift-reduce" approach.
Technically both are O(n), so the best case is always the same. But the old implementation runs over the *complete* list multiple times until it cannot make any more optimisations. The new implementation only repeats the optimisation on elements which require reconciliation.
Tests on a local machine have shown a considerable increase in speed on large collections of elements (iirc about twice as fast on average).
----------
components: Library (Lib)
files: faster-collapse-addresses.patch
keywords: patch
messages: 212553
nosy: exhuma, ncoghlan, pmoody
priority: normal
severity: normal
status: open
title: Faster implementation to collapse consecutive ip-networks
type: performance
versions: Python 3.5
Added file: http://bugs.python.org/file34267/faster-collapse-addresses.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20826>
_______________________________________
More information about the Python-bugs-list
mailing list