From: Charles O Nutter Date: 2006-08-04T03:21:09+09:00 Subject: Re: For performance, fix the Java program ------=_Part_92017_25434204.1154629254949 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/3/06, Peter Hickman wrote: > > Isaac Gouy wrote: > > 1) Over the past 3 or 4 days, people have said what's wrong with the > > way you're producing output in Java, and suggested what you should do > > instead. Is it that you don't know enough Java to follow their > > suggestions and fix the program? > > > So far the only language that has come close to running as fast as the C > is the Ocaml version and since then I have found other ways to speed up > the C version. Just as I have posted the Ruby and Ocaml version if any > certified Java expert cares to show me how it should be done (*cough* > Charles O Nutter *cough*) then I will be happy to time it and check the > output and report the results. That way we can get away from all this > stupidity like the fact that I didn't use the correct naming convention. > Which we all know hugely affects performance. But remember that the > timings will be based on a program that produces output. My original two emails about the Java version described *in detail* what changes were needed to fix it. I also offered to post my version of the code. I never got any response to that email, and you've still got the old 29-second numbers posted on your page. I find it hard to believe you actually want to fix the Java version when *numerous* people have told you exactly how to do so, and you seem to have missed all of them. > Yesterday I emailed you another version of your Java generating Perl > > script that fixes those print problems, the output matches the C > > program output. > > > If it was the email I replied to yesterday then reason that it got close > to the speed of the C version was because it didn't do any output. Once > I put the output back in it was only around 5 seconds faster than my own > Java version and around 15 seconds slower than the C version. Hardly > encouragement to drop C and pursue Java. Remember I am running the > program to get the output. You may have to accept the fact that the G4 version of Java is not as fast as current versions. I doubt there's a Java 6 for the G4, but it would be worth trying if there is. Everyone except you seems to have no trouble getting the Java version to run fast, even with output. Ultimately, however, I don't think you really care...if you're trying to get the job done and this is the best Java code you could write, perhaps you should not use Java. Sorry to put it bluntly, but benchmarking and Java programming do not appear to be your strong areas. Actually the real problem is the amount of disk space I need to store > the output. 6 x 6 resulted in 32Gb of output. The 7 x 7 will probably > eat my hard disk well before it completes. I'm not sure that the 1Tb I > have will be enough so I am looking at removing the rotational and > mirrored versions of the grids from the output. I think you're goint to have some trouble regardless of the algorithm. The data set for latin squares grows extremely fast, and you're unlikely to ever get above 6x6 calculating in realtime. See http://mathworld.wolfram.com/LatinSquare.html "The numbers [image: N(n,n)] of Latin squares of order [image: n==1], 2, ... are 1, 2, 12, 576, 161280, ... (Sloane's A002860 )." I think you're going to run out of space pretty quick, not to mention the time it's going to take to calculate. -- Contribute to RubySpec! @ www.headius.com/rubyspec Charles Oliver Nutter @ headius.blogspot.com Ruby User @ ruby.mn JRuby Developer @ www.jruby.org Application Architect @ www.ventera.com ------=_Part_92017_25434204.1154629254949--