Some performance improvements

Hi @parnurzeal,

here are some small improvements increasing performance a little bit.

Feedback welcome!

Cheers,
Ingo alias @nightlyone