On Sat, 4 Mar 2006 08:41:53 -0800, Dale Welch <[EMAIL PROTECTED]> wrote:
>But everyone always knew java was slow. It wasn't meant >to be able to be your primary language for large projects. This is where I have do disagree, having used Java. Example: I wrote a piece of linguistic software in Java. It needed an lot of HEAVY string handling. Using the wrong technique in concatenation (Strings instead of StringBuffer) I would have had problems. Using the language in a correct manner (Strings where necessary and StrinbBuffer in everywhere else) I got all the functionality I needed and the performance was excellent. Using just Strings is one of the common mistakes that causes low performance when lots of concatenations are done as every concatenation creates a new object. I want to point out that I also wrote a very exotic Replace function in plain Java that I thought would NEVER be fast enough, knowing that I am dealing with bytecode. To my surprise the code was faster than I could ever have dreamed and could be run just like any native .exe. Three years later I wrote the same routines in PHP and used every possible piece of optimization I could think of (and I know PHP very well). I ended up with junk that used 40x CPU compared with the Java one. And believe me, I did everything I could think of. Nope, the PHP can only be used if I write the critical parts (~50% of the application code in C as a PHP extension. So there is a difference between a bytecode/JIT-compiled and a sort-of-compiled language. After that I thought of rewriting the same app in FPC but have not yet had the time to start the project. What I noticed, however, was that a lot of work should be done to achieve the same functionality the Java String/Stringbuffer/Tokenizer classes have - we do not have them in plain FPC. What I really miss is in FPC the multitude of good classes, good functions that Java has. Tokenizer is a good example of a effort-saving utility class that is very well written in Java. Java is definitely NOT slow if written properly and used properly. At least Java basic things (String handling, hash maps, loops etc) perform very well compared with just about any language. With lots mathematics, matrixes and things like that I know less about things may be different though. As for large projects anybody can have a look at Eclipse. In my latest project it was chosen as the default environment and we never had any performance problems with it... not to mention big sites with JSPs and servlets and the J2EE abstraction level. Markku -- [EMAIL PROTECTED] _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives