From: "Eric I." Date: 2008-01-29T04:59:59+09:00 Subject: Re: Making Change (#154) On Jan 28, 11:21 am, tho_mica_l wrote: > Here is an possible overview that includes only basic tests most > people > agreed on: > >       user     system      total        real > solution_eric.rb  0.380000   0.000000   0.380000 (  0.380000) > solution_gray.rb  3.295000   0.000000   3.295000 (  3.304000) > solution_ludtke.rb  1.552000   0.000000   1.552000 (  1.553000) > solution_paolo.rb  0.942000   0.190000   1.132000 (  1.171000) > solution_paolo_eric.rb  0.751000   0.190000   0.941000 (  0.972000) > solution_porth.rb  0.661000   0.000000   0.661000 (  0.661000) > solution_tml1.rb  0.050000   0.000000   0.050000 (  0.050000) > solution_tml2.rb  0.200000   0.000000   0.200000 (  0.200000) > solution_yoan.rb  0.241000   0.000000   0.241000 (  0.281000) Those times are awfully small, and I wonder if they're masking some useful differences and magnifying some less meaningful differences. For example, I have a test that I've been using, which combines Phrogz's, vsv's, and some of my own. When running with Ruby 1.8.6, I get: Paolo: 27.919662 s Eric: 25.756986 s tho_mica_l_1: 20.899582 s (note: modified for Ruby 1.8.6) Paolo (w/ Eric mod): 19.207968 s And that gives a different sense than tho_mica_l's solution being 19 times faster than Paolo's. So I suspect depending on whether you're using 1.8.6 vs. 1.9, and whether or not you use test cases that require larger search spaces, you're likely to get different results. Eric P.S. To convert the tho_mica_l_1 solution for Ruby 1.8.6, I had to add the odd? and even? methods to Integer and convert 'changer' into a method.