Optimize search by 3,000 terms

We wish to add to our current solution the option to query by a high number of terms, a list of 3,000 id's. Today our performance measure in few milliseconds, and the additional term query has a large impact. What can we do to optimize to guaranty a few milliseconds response time?
Thanks a lot