sapling/lib/dag
Jun Wu 20dfef4801 bindings: implement lazy iteration on spans
Summary:
The SpanSet can include a large amount of revs. Iterating through it by putting
everything in a PyList is suboptimal. Therefore add a dedicated native iterator
for it. This speeds up iteration greatly, which can be verified via debugshell:

Before:

  In [1]: s=m.smartset.spansset(b.dag.spans(xrange(5000000)))
  In [2]: %time s.slice(0,10)
  CPU times: user 135 ms, sys: 42.9 ms, total: 178 ms
  Wall time: 180 ms

After:

  In [1]: s=m.smartset.spansset(b.dag.spans(xrange(5000000)))
  In [2]: %time s.slice(0,10)
  CPU times: user 49 µs, sys: 6 µs, total: 55 µs
  Wall time: 58.2 µs

Reviewed By: sfilipco

Differential Revision: D17305350

fbshipit-source-id: 0db00aa57fb6bf2141ccea94b2536da78f103cef
2019-09-23 17:11:21 -07:00
..
benches dag: implement descendants 2019-09-17 12:36:45 -07:00
src bindings: implement lazy iteration on spans 2019-09-23 17:11:21 -07:00
Cargo.toml dag: add a flag storing whether a segment has roots 2019-09-13 19:31:00 -07:00