add memoization to some things that are repeated several times
Hopefully this increases performance a bit so we don't have to parse events a billion times.
Hopefully this increases performance a bit so we don't have to parse events a billion times.