21.6.07

URLEncoder/URLDecoder way too slow

As I recently found out by trying, the methods encode in java.net.URLEncoder and decode in java.net.URLDecoder are way too slow.
Following an advice, I replaced these calls with encode and decode from class org.apache.commons.codec.net.URLCodec which is part of the Apache Commons Codec library.

Running the same application with Java's built in coding logic and another time with Apache's, showed me that Apache's solution is about 10 times faster (round about, this is not an official statistic, but should give a quite good estimation).

In my project JGAP (Java Genetic Algorithms Package) the versions up to 3.2 RC2 run with the slower mechanism, while the currently available CVS version uses the improved solution.

If you like JGAP I would be grateful if you voted on Sourceforge for JGAP as the project with the best user support. Please try out yourself by posting a (hopefully qualified) question. Also see the myriads of unit tests JGAP offers as well as the near-to-complete Javadoc and the many examples!