Optimization of incremental encoder

yes ,my encoder when i tested it slowly with hands it counts 4096 .

red - 5v
black - Gnd
green - 9
white - 8