Lire: CEDD linear search now 10% faster

Due to comments from a friend I re-investigated the Tanimoto coefficient implementation of the CEDD class and could just delete an unnecessary “if” statement. This results in a 10% speedup in tests of linear search with 150k images. With the new implementation search takes ~460 ms (averaged over 10 runs) on a 64-bit VM, quad-core, 8GB RAM with the index being on a SSD. Find the new version in the SVN.


One thought on “Lire: CEDD linear search now 10% faster

  1. Eric Jacobsen

    Hi Mathias, the code in CEDD::getDistance uses a divide to normalizes the values. You might get a small speedup by multiplying by the inverse. Sorry I did not try it. I admire your work on LIRE, thanks for making it available.
    double iTmpInverse1 = 1.0 / iTmp1;
    double iTmpInverse2 = 1.0 / iTmp2;
    for …
    iTmp1 = tmpFeature.histogram[i] * iTmpInverse1;
    iTmp2 = histogram[i] * iTmpInverse2;
    rather than:
    iTmp1 = tmpFeature.histogram[i] / Temp1;
    iTmp2 = histogram[i] / Temp2;

Comments are closed.