Profiling optimizations, faster palette lookups