I think that you will be very lucky to find any ready made code to meet your requirements. You have obviously tried to read from the encoder. Please post an example of the program that you tried that caused you to conclude that the Arduino could not keep up with the impulses from the encoder. A circuit diagram would also be helpful in understanding what you are doing and how.
What do the figures that you quote relate to in respect of the maximum number of pulses to be read in a period and/or the minimum time between pulses ?