From: Jeremy W. <jez...@ho...> - 2005-10-14 08:08:30
|
Hi, Interesting discussion on many levels. Impressive work. My 2 cents. For an unrelated problem I did some research yesterday about when to use a hashing algorithm verses a liner search or a binary search. Basically, I have a list of strings - some times the list is small (less than 5 items) and some time is it is longer (20 items plus [could be hundreds]). I'm currently using perls hashing functions via XS and as this list is used often I wondered if using perls hashing was the way to go. An interesting link: http://en.wikipedia.org/wiki/Hash_table "The optimum performance point varies from system to system; for example, a trial on Parrot shows that its hash tables outperform linear search in all but the most trivial cases (one to three entries)." Other than testing different approaches there wasn't a clear answer. So I left the code as it was:) >With the following conclusions: >1. In all cases the new algorithm is faster. This differs > from the results at work in which the Minimum test showed > that the existing algorithm was faster. This is not meant to be a criticism- so please don't take it as such - but I'm not convinced that it's worth speeding up this area of Win32::GUI. Even if this algorithm was several orders of magnitude faster it wouldn't make that much difference (if at all) to a running Win32::GUI programme. When you first mentioned this I did some analysis on how often this function is called and when, and I was surprised at the conclusion. Even for a large Win32::GUI app, we're only talking several hundred calls, and mostly when the app starts. Now this usage profile could just have been my app - so I could be wrong:) Cheers, jez. |