Subscribe to Grim's Projects        RSS Feed

Version 2.11

Icon 3 Comments
Well, I thought Mimesis was pretty much done updating, but it just goes to show you that you an always teach an old ffdb some new tricks. A visitor to my site using the nickname ilmich posted on my contact page about an optimization he'd developed that improved some of Mimesis's operations twofold.

I was surprised to say the least. Moreso that someone actually read through and understood my code. ilmich pointed out an interesting piece of vestigial code I had left in Mimesis from a previous version. It still did the job, but as the operational structure of the database and insertion had changed it meant I could change the procedure to speed it up.

Mimesis uses a heap method of storage, and in one of its permutations row labels could be duplicated. In order to get the most recent and unique row label I used a method combining array_flip and array_key_exists. At some point I made an improvement where row labels HAD to be unique within the structural file (i.e. no repeats). I didn't modify the procedure using array_flip and array_key_exists that were present in 3 of the methods.

Thanks to ilmich and his suggestion of using in_array I was able to realize this. Going from his code I've instead chosen to implement the array_search function as its also compatible with PHP version 4.3.2 and it does the job of ilmich's code in one function; which is also likely faster.

Inasmuch as this is to let the Dream.In.Coders know about the new version release its also an homage to ilmich for being the first Mimesis user ever to help the author. Thanks again ilmich.

3 Comments On This Entry

Page 1 of 1


17 August 2010 - 08:16 PM
Glad to hear you're still working on this (at least in some capacity). :)


17 August 2010 - 10:30 PM
Oh absolutely Tom, I've never stopped working on it. What I meant to say was looking at the code myself, unless I learn something new or somehow come up with an improvement I just figured it was complete. I know there's always room to better your code, but I've looked over it so many times that I'm just happy to have another pair of eyes give me some new thoughts. Besides, Mimesis is only the first step in what I hope to be the revival of my GrimBB project. A pirate's work is never done.


19 August 2010 - 12:07 AM
Actually updated to v2.12. It seems ilmich's small alteration had a grander effect than I gave him credit for. Or rather my hiatus gave me a chance to approach my code with new eyes. I found a bug (now fixed), and reworked some code for better results.
Page 1 of 1