(possibly) significant speedup coming up
So, I was trying to find a way to optimize the slowest parts of sims3py. And serendipity found me this:
http://eli.thegreenplace.net/2011/11/28/less-copies-in-python-with-the-buffer-protocol-and-memoryviews
This is the first time ever I heard about "buffer protocol" and "memoryview".
Reading the article and digesting the information, I suddenly realize that these pair of Python features could very likely be the key to a performant Python program!
You see, sims3py has to do a HUGE amount of slicing and dicing. Every invocation of slicing apparently creates a copy of the buffer. And if the copy doesn't neatly fall into the size of the memory page, performance will suffer.
After finding out about these two Python features, I see how I can speedup the operations by preventing memory copy. The article mentions a 300x speedup; but honestly, I'll take it even if it promises only 2x speedup.
I'm giddy with excitement! Stay tuned on the repo for some speed boostin' commits!