We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I've only quickly glanced over your code, so its quite possible I missed something. But...I think your basic problem is lack of re-use. Caches give you a benefit when you re-use data. The first time you access something (say a global variable) it must be read from external memory. The second, third, fourth (etc...) time you can use the copy in the cache.Your test only seems to be reading the data once. So you never get the benefit of re-using the data that's now in the cache.