Re: synchronized code

Поиск
Список
Период
Сортировка
От Michael Paesold
Тема Re: synchronized code
Дата
Msg-id 01be01c2b752$d10e45d0$3201a8c0@beeblebrox
обсуждение исходный текст
Ответ на synchronized code  (Felipe Schnack <felipes@ritterdosreis.br>)
Ответы Re: synchronized code  (Felipe Schnack <felipes@ritterdosreis.br>)
Список pgsql-jdbc
Felipe Schnack <felipes@ritterdosreis.br> wrote:

>   Is... but what got better with JVM 1.4 was synch'ing not object
> creation, so you're basically saying I'm correct? :-)

I think it depends on the virtual machine, but I'm no expert.

I just had a look at the latest StringBuffer sources. What setLength(0)
does, is to wipe the whole buffer with null-bytes ('\0') in a loop! Although
I have no idea why it is done, it seems to be very inefficient. Especially
when you think of the fact, that this single StringBuffer will grow,
everytime a bigger string is put into it. It seams that sb.delete(0,
sb.length); is much more efficient. It just resets the internal length
counter?

Any comments?

Regards,
Michael Paesold


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Joseph Shraibman
Дата:
Сообщение: Re: ArrayIndexOutOfBoundsException in Encoding.decodeUTF8()
Следующее
От: Joseph Shraibman
Дата:
Сообщение: Re: ArrayIndexOutOfBoundsException in Encoding.decodeUTF8()