difference between magnetic rotary encoder and mechanical rotary encoders
Which technology, and cost involved, really depends on more than just performance.

If this is for automotive and is intended to be used for operational use, i.e. not just testing, you should stay clear of optical or mechanical encoders. 

Optical will be hard to keep sealed and clean in the grunge that is an engine compartment, and mechanical encoders are basically just a rotary switch which are also easily contaminated and have wear issues.

Magnetic is probably your best bet.

However, rather than using a complete encoder, using a hall effect sensor to detect the cogs on your engines flywheel, assuming that gives you enough angular resolution, with another somewhere to detect once per revolution, would be a simpler approach.

Actually, if your engine is fairly modern it may already have such sensors already installed.