Skip to content
This repository has been archived by the owner on Oct 30, 2021. It is now read-only.

Optimize coalesceSingle #65

Merged
merged 4 commits into from
Dec 17, 2016
Merged

Optimize coalesceSingle #65

merged 4 commits into from
Dec 17, 2016

Conversation

yhahn
Copy link
Member

@yhahn yhahn commented Dec 17, 2016

Adds some non-invasive optimizations to coaleseSingle taking advantage of the fact that covers are sorted in relev, score descending order. Since the cutoff for coalesce is 40 features, we can also short circuit intelligently based on this cutoff.

  • When not using proximity or bbox, we can short circuit after the 40th unique feature ID is collected
  • When using proximity/bbox, we need to iterate further but can know intelligently when we've reached a cutoff point where no further iteration will yield more useful features, because:
    • Covers are sorted by relev first. If the relev of subsequent features in the loop drops below the smallest relevance collected and we have 40 features already, we're done

I've tested this with carmen + IRL scenarios to consider it ready for tagging.

Benchmark numbers

IRL benchmarks are more meaningful but for the synthetic coalesceSingle() scenarios:

master

# coalesceSingle
ok 1 coalesceSingle @ 1.88ms
# coalesceSingle proximity
ok 2 coalesceSingle + proximity @ 2.26ms

early-death

# coalesceSingle
ok 1 coalesceSingle @ 0.24ms
# coalesceSingle proximity
ok 2 coalesceSingle + proximity @ 0.38ms

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant