The code was ridiculously inefficient for large OR sets. Trying
to assemble an OR term with 28'000 subterms took minutes and the
process eventually ran out of memory. Instead just use a for loop
and a bit of counting to balance the parentheses, the string
is assembled within milliseconds.
Details
Details
- Reviewers
vkrause - Group Reviewers
KDE PIM - Commits
- R177:b0529aff00ba: SearchJob: don't assemble OR term recursively
Added a test to make sure the serialized string is the same as before
A benchmark for 10'000 subterms took 4 seconds. Benchmark for 28'000
subterms got killed by the OOM-killer. After the patch the benchmark
for 28'000 subterms took 2.2 ms.
Diff Detail
Diff Detail
- Repository
- R177 PIM: KIMAP
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.