You seem to have many similar constructs. Here you should look at using ‘else if ’ statements to avoid unnecessary calculations after your match has been found.
It is not clear how you are calling the containing function but, if the engine speed does not change enough to force a new display pattern, you should avoid calling that function. Again to minimize unnecessary calculations.