Mentions légales du service

Skip to content
  • Mikaël Salson's avatar
    ReadChooser: Speed-up ReadChooser, hence representative computation. · 10108137
    Mikaël Salson authored
    ReadChooser was storing all the sequences and score in a map (log-time access)
    and then reads were stored in a vector which was sorted depending on the
    scores stored in the map. So we had many allocations (map+vector) and a slow
    access (log access time, so the sort was in n log²n, where n is the number of
    sequences). I'm a bit ashamed to have done such an inefficient thing.
    
    Now the scores and the sequences are stored in an array. The sequences
    are not copied, but just a pointer to them is stored.
    
    The C function qsort is used because the C++ sort doesn't work
    (because of implicit destruction of something).
    
    The code is now much quicker (a -c clones of 600k reads, with -z 1 is now twice as fast).
    
    Someone motivated could probably do better with a radix sort.
    10108137