----- Original Message ----- From: "Markku Niskanen" <[EMAIL PROTECTED]> To: <lazarus@miraclec.com> Sent: Saturday, March 04, 2006 4:20 PM Subject: Re: [lazarus] Object pascal a "Modern Language"
> 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. Maybe a StringBuffer type is needed for pascal for very large strings that constantly change via concatenations. Instead of reserving memory for the ansistring to whatever amount you request, the stringbuffer type would reserve extra memory for you in a specifyable increment (256K, 128K, 20K, whatever you choose). If the string has a concatenation on queue which is larger than the increment size, then the stringbuffer allocates enough memory with overlap (several increments until it fills the need). _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives