From: | Dave Cramer <pg(at)fastcrypt(dot)com> |
---|---|
To: | Thomas Hallgren <thhal(at)mailblocks(dot)com> |
Cc: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: PostgreSQL 8.0 Feature List? |
Date: | 2004-08-16 14:27:04 |
Message-ID: | 1092666424.1550.85.camel@localhost.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Thomas,
It was a simple example. My point was that no modern java compiler will
actually concatenate strings by instantiating and copying. They will
either do as Thomas suggests, or in more complex examples use .append()
Dave
On Mon, 2004-08-16 at 10:13, Thomas Hallgren wrote:
> Dave Cramer wrote:
>
> > Richard,
> >
> > Actually, I think you will find that current implementations of java
> > will actually take
> >
> > String foo = "Hello " + "World" and rewrite it into
> >
> > String foo = new StringBuffer("Hello").append("World").toString()
> >
> > But your point is still valid.
> >
> Oh c'mon. Give the current Java compilers some more credit.
>
> Most Java compilers, will optimize string concatenation whenever
> possible. The examples given here falls into the category of simple
> constant evaluation. The above example will be optimizied into:
>
> String foo = "Hello World".
>
> The same is true for Richards example.
>
> Try it yourself. Compile a simple program "Hello " + "World" in it, then
> use jad to decompile, or if you don't have it available, use strings(1)
> on the resulting class file.
>
> Regards,
>
> Thomas Hallgren
>
>
--
Dave Cramer
519 939 0336
ICQ # 14675561
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2004-08-16 14:36:45 | Re: Does a 'stable' deferred trigger execution order exist? Is housekeeping for deferred trigger fire events done in one of the system catalogues? |
Previous Message | Tom Lane | 2004-08-16 14:26:06 | Re: plpgsql NULL statement (was Re: [GENERAL] Postgres |