Re: bytea memory improvement - Mailing list pgsql-jdbc

From Luis Vilar Flores
Subject Re: bytea memory improvement
Date
Msg-id 44EC6AA5.10205@evolute.pt
Whole thread Raw
In response to Re: bytea memory improvement  (till toenges <tt@kyon.de>)
List pgsql-jdbc
till toenges wrote: <blockquote cite="mid44EC66B0.2040108@kyon.de" type="cite"><pre wrap="">Luis Vilar Flores wrote:
</pre><blockquotetype="cite"><pre wrap="">    Hope to hear some feedback soon, hope I didn't forget anything ...
</pre></blockquote><prewrap="">
 
I have an idea for a minor improvement. The MAX_3_BUFF_SIZE is set to 0.
Actually, you can immediately return an empty byte array if the size of
the incomming buffer is 0; that could be a static final byte[], because
nobody could do anything with it anyway. In all other cases, the 2
buffer method is simpler and faster, because it uses fewer buffers and
memory accesses, and is therefore the right solution.


Till
 </pre></blockquote> The MAX_3_BUFF_SIZE can be deleted (and the test that use it too), it was these so that we can set
asize threshold to use 3 buffers (old algorithm), or only 2 (at the beginning it seemed that 2 buffers were slower).<br
/><br/> If the incoming size is 0 we can use the incoming array, I tried to only change the buffer algorithm, the null
casefor instance was already there.<br /><br /> Thanks for the comments,<br /><br /><div class="moz-signature">-- <br
/></div><p><fontcolor="#7da647"><font face="Verdana, sans-serif"><font size="2" style="font-size: 10pt;"> Luis Flores
</font></font></font><p><fontcolor="#7da647"><font face="Verdana, sans-serif"><font size="2" style="font-size: 8pt;">
Analistade Sistemas</font></font></font><p><a href="http://www.evolute.pt"><font face="Verdana, sans-serif"><font
size="2"style="font-size: 8pt;"><b>Evolute</b> - Consultoria Informática<br /><br /></font></font></a> <font
color="#7da647"><fontface="Verdana, sans-serif"><font size="2" style="font-size: 8pt;"> Email: </font></font></font> <a
href="mailto:lflores@evolute.pt"><fontface="Verdana, sans-serif"><font size="2" style="font-size:
8pt;">lflores@evolute.pt</font></font></a><p><font color="#7da647"><font face="Verdana, sans-serif"><font size="2"
style="font-size:8pt;"> Tel: (+351) 212949689</font></font></font><div style="text-align: justify;"><font
color="#7d7d7d"><fontface="Verdana, sans-serif"><font size="1" style="font-size: 7pt;"><br /> AVISO DE
CONFIDENCIALIDADE</font></font></font><br/><font color="#7d7d7d"><font face="Verdana, sans-serif"><font size="1"
style="font-size:7pt;"> Esta mensagem de correio electrónico e eventuais ficheiros anexos são confidenciais e
destinadosapenas à(s) pessoa(s) ou entidade(s) acima referida(s), podendo conter informação privilegiada e
confidencial,a qual não poderá ser divulgada, copiada, gravada ou distribuída nos termos da lei vigente. Caso não seja
odestinatário da mensagem, ou se ela lhe foi enviada por engano, agradecemos que não faça uso ou divulgação da mesma. A
distribuiçãoou utilização da informação nela contida é interdita. Se recebeu esta mensagem por engano, por favor
notifiqueo remetente e apague este e-mail do seu sistema. Obrigado. <br /></font></font></font><font
color="#7d7d7d"><fontface="Verdana, sans-serif"><font size="1" style="font-size: 7pt;"> </font></font></font><br
/><fontcolor="#7d7d7d"><font face="Verdana, sans-serif"><font size="1" style="font-size: 7pt;"> CONFIDENTIALITY
NOTICE</font></font></font><br/><font color="#7d7d7d"><font face="Verdana, sans-serif"><font size="1" style="font-size:
7pt;">This e-mail transmission and eventual attached files are intended only for the use of the individual(s) or
entity(ies)named above and may contain information that is both privileged and confidential and is exempt from
disclosureunder applicable law. If you are not the intended recipient, you are hereby notified that any disclosure,
copying,distribution or use of any of the information contained in this transmission is strictly restricted. If by any
meansyou have received this transmission in error, please immediately notify the sender and delete this e-mail from
yoursystem. Thank you. </font></font></font></div> 

pgsql-jdbc by date:

Previous
From: till toenges
Date:
Subject: Re: bytea memory improvement
Next
From: "j.random.programmer"
Date:
Subject: Some simple JDBC profiling results