The Image Distortion Model (IDM) has shown good retrieval quality in previous runs of the medical automatic annotation task of previous ImageCLEF workshops. However, one of its limitations is computational complexity and the resulting long retrieval times. We applied several optimizations, in particular the use of an early termination strategy for the individual distance computations, the use of optimized data structures for the intermediate results, and the proper use of multithreading on state-of-the-art hardware.