coryodaniel / arbor

Ecto elixir adjacency list and tree traversal. Supports Ecto versions 2 and 3.
MIT License
239 stars 26 forks source link

Slow Arbor.Tree.ancestor/1 performance w/ table over 1mm records #11

Closed coryodaniel closed 7 years ago

coryodaniel commented 7 years ago

Descendants, siblings and children perform very well (tested up to 15mm rows). Ancestors runs at about 4s / query at 1mm nodes and times out on 15mm nodes...

See arbor bench

Running siblings
    10000 runs
    Total time: 2.3324530000000046
    Avg: 2.3324530000000046e-4
Running children
    10000 runs
    Total time: 2.1838109999999857
    Avg: 2.1838109999999857e-4
Running descendants
    10000 runs
    Total time: 2.141958000000028
    Avg: 2.1419580000000277e-4
coryodaniel commented 7 years ago

Resolved in 1.0.3