6.02.2012

Leveled memoization

While randomly browsing through my ITK headers, I found a few ones that I didn't continue or improve since I created them, so I picked up a few and got a great idea. I've been tinkering with memoization thoughts for quite some time now and my own set of functions around it was... rather disappointing. I also tinkered with something I called "update map", which's effectively a set of values and associated levels. Every time a level is below the global level, a new value will be applied on access (passed via parameter). This IS effectively a specialized memoization and for some reason I didn't realie that. Anyway, what would happen if we apply to same concept with some more extension a general memoization approach? You wouldn't need to reroll the whole calculation trigger thing and you can change the up-to-date status with one single assignment. Of course you sacrifce check speed but that doesn't count for memoization as your function should have more overhead than a function call itself to make memoization worth it. Anyway, I really love the contcept but I don't find any good use other than math-heavy stuff or heavy allocation/initialization. After all, it's barely guaranteed that your compiler will inline a function call made from an arbitray function pointer... So I'm not yet convince to use it everywhere, but it's awesome enough to have and play with it. Should speed up a few things in image processing I guess as well as in my game engine (maybe). Yeah... I just love this stuff. How nerdy. Oh, on a sidenote: I did some good progress reworking a lot of stuff and can now continue with IGE. Seeing how ridiculous the engine we use at work is, I love to see how clean and simple all my things are so far. You can see EVERYTHING in the debugger compared to just too many blackboxes and fully scattered random objects...

No comments: