Can we please delete this line:
(message "History item: %d" (1+ pos))
form comint-previous-matching-input in comint.el? It provides no value and makes searching the history very slow, at least on a Mac, when a large part of the history has to be searched.
Basically, with these messages in place, one of two things happens:
1. They go by so fast as to be unnoticeable (this happens on my Ubuntu desktop).
2. They go by slowly and make the search excruciatingly slow (this happens on my Mac).