Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance Issue with Overlaps #36

Closed
almondtools opened this Issue Aug 9, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@almondtools
Copy link

almondtools commented Aug 9, 2016

I encountered a performance problem, documented in a Unit-Test https://github.com/almondtools/stringbench/blob/master/src/test/java/com/almondtools/stringbench/incubation/ACAhoCorasickIncubationTest.java.

I tracked down the reason: The removeOverlaps-Method removes overlaps in an inefficient way. The experiments show, that following section is the critical one:

for (Intervalable removeInterval : removeIntervals) {
   intervals.remove(removeInterval);
 }

Doing this on an ArrayList consumens O(n^2) and an ArrayList containing millons of elements will have long to work.

@DaveJarvis

This comment has been minimized.

Copy link
Collaborator

DaveJarvis commented Nov 30, 2016

See issue #35, which suggests a different list implementation for DefaultEmitHandler.

@DaveJarvis DaveJarvis closed this Nov 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.