Image thresholding is one of the most common image processing operations, since almost all image processing schemes need some sort of separation of the pixels into different classes. In order to find the thresholds, almost all methods analyze the histogram of the image. In most cases, the optimal thresholds are found by either minimazing or maximazing an objective function, which depends on the positions of the thresholds. We identify two classes of objective functions for which the optimal thresholds can be found by algorithms with low time complexity. We show, that for example the method proposed by Otsu  and other well known methods have objective functions belonging to these classes. By implementing the algorithms in ANSI C and comparing their execution times, we can make a quantitative statement about their performance.