Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Algorithm challenge: compacting integers

From: SunandaDH::aol::com at: 30-Jan-2007 14:11

Thanks to everyone who entered the first two challenges of this thread! Comparing the code =E2=80=93 especially that of entries far better than mine - has give me some insights into writing tighter, faster REBOL code. I hope everyone who has joined in (even if you did not contribute any entries) has also benefited in the same way. Here are the results! But first, the small print...... ....Benchmarking the entries to find the "fastest" is neither *easy* nor *fair*.... ....Different solutions are optimised for different sized sets of integers, and make different assumptions on how sparse the integer set will be. I reckon every one would be a winner (or close runner up) under the right set of data..... ....So what I've done is construct a set of data that closely resembles the operating conditions for the indexes on the Mailing List Archive. After all, that is the application for which I specifically need faster / better code And the benchmarks below time the entrants on that set of data.... ....The fastest in this benchmark is best suited for current Library data, not the fastest under every circumstance. *** RESULTS ....compact ......(fastest first) Brian/12 0:00:57.19068 Chris/17 0:00:59.13268 Viktor/9 0:01:11.85888 Dirk/14+18 0:01:11.9278 Anton/7 0:01:30.90328 Sunanda/11 0:01:57.09756 Paavo/15 0:09:22.61968 ....decompact ......(fastest first) Viktor/9 0:00:38.06628 Anton/7 0:00:40.4418 Sunanda/11 0:00:58.33468 Paavo/15 0:01:40.83708 Dirk/14+18 0:05:20.1466 (The number after the name is the sequence in the thread where the code was published). *** Congratulations to everyone who entered! And especially to Brian for the fastest 'compact, and Viktor for the fastest 'decompact. *** For anyone who wants to audit the results (especially to check if I have run the right version of your code -- some people contributed several, and I may have got a confused), the test driver and test entries are here: *** Thanks again, and good luck with the next three challenges! Sunanda