PIsaacson wrote:It is possible to compile Java code into native machine code using the GNU gcj compiler. Instead of a virtual java machine interpreter, it literally uses several libraries (libgcj/libgcjgc...) to provide standard Java service functions. I used this technique several years ago on some Java code to "cheaply" halve the process time. I don't have gcj on my current mingw installation and I don't see where there is one easily available other than on cygwin and/or linux, so I'll try building a mingw gcj using the latest gcc 4.5.1 source code. If I'm successful, it might help with the decisions of whether or not to convert/rewrite various SE algorithms into C/C++.
As for "blind porting" Java to C or C++, using C++ and STL in lieu of the Java classes is probably much easier than converting to standard C. Again, this is from some heavy lifting of Java code to C++ when we were looking for more than a doubling of speed. Essentially, we finally redesigned internal structures and algorithms using C++/STL/Boost to simplify the code and vastly reduce the processing time.
If we take the time to define a relatively complete set of techniques (including things such as sk-loops, exocets, ribbons, nrc whips/braids ...) and design a framework that easily allows for additional techniques and scoring algorithm changes, then the project should prove to be very interesting. SInce I use mingw/gnu C++/STL/Boost, that would be my choice for platform development, especially since using the C++ compiler doesn't prohibit writing functions in standard ansi C code.
Cheers,
Paul
I would agree on most of paul's remarks.
In a blind optimisation, we can expect an improvement in a ratio of 1/2 or i/3 at most.
I don't see any penalty to the use of C++ compared to C.
The problem with SE rating is to my view the use of forcing chains in the set or rules. For "hardest puzzles", the runtime ratio between SE and my solver is about 1/1000, but I excluded from my set of rules nearly all technics assuming a search using a start candidate or group of candidates.
Changing the set fo rules is an heavy decision.
Moving to C or C++ will have a poor efficiency ratio if a compiled version can be produced easily as writes paul.
But the problem of compiled versions is not so easy to solve. I am programming in C++. I worked before with an old version of Borland's compiler. I am now using the free Microsoft visual C++. I had to re write some parts of the code to switch from one to the other. The huge advantage of Java is just to avoid these traps.
I think the best result would come from an agreed optimisation of the program keeping Java as langage, but adjusting the set of rules. What is not exactly the initial proposal. I made that on my own solver.
My second best proposal would be the use of C++, if and only if the compiling issue is solved;
champagne