Re: Question about speed: Weird Behavior

From: Israel Ben Guilherme Fonseca <israel(dot)bgf(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Question about speed: Weird Behavior
Date: 2011-06-14 01:07:32
Message-ID: BANLkTi=HKOK1P0URDTidBuaqGJ2uptzT_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

(Craig, this post answer your question: yes with few iterations the values
get stable)

Here it is my new test:

http://pastebin.com/efK34FW1

I execute it passing the parameter "select" or "count", they define what
statement will be used for "warm up". With this warm up, CPU/Java
Initialization/random things, get less chance to affect the main test.

When I use the count, my timings get around of

100 miliseconds.

When I use the select it goes to

30 miliseconds.

I executed those tests many times with this bash script:

#!/bin/bash
for i in {1..20}
do
eval "java -jar tests.jar $1"
done

The reason for this is probably because the size of the packages of the
"count statement" aren't enough to trigger the "tunning" of automatically
changing the size of the packets. With the select it does.

My question is simple, can I change this behavior somewhere? Is it a Java
(Socket maybe) or Postgresql configuration?

Thanks in advance,

2011/6/13 Israel Ben Guilherme Fonseca <israel(dot)bgf(at)gmail(dot)com>

> Thanks for all the answers,
>
> Smogura: "This is system autotuning - a good solution."
>
> Where can I find more about this subject, and how can I weak it? Is it
> hidden on postresql.conf? Can I configure it to always use an specifc size
> like 8258 bytes per-package?
>
> I'm doing tests on other drivers of other programming languages to
> postgresql, and for those, there wasn't any package size differences, only
> with the Java tests. Maybe the others drivers are setting specific values
> for this.
>
>
>
> 2011/6/13 Maciek Sakrejda <msakrejda(at)truviso(dot)com>
>
>> > There may be some GC
>> > overhead, you should call System.gc after or before each pass to start
>> with
>> > similar environment.
>>
>> Note that the contract of System.gc() is really more like "Hey, I
>> think it might be fun to run GC right now," than "You'll run GC right
>> now and you'll like it." In other words, it's technically only a
>> suggestion, so you should make sure it's actually doing something
>> before you start depending on it for performance numbers.
>>
>> ---
>> Maciek Sakrejda | System Architect | Truviso
>>
>> 1065 E. Hillsdale Blvd., Suite 215
>> Foster City, CA 94404
>> (650) 242-3500 Main
>> www.truviso.com
>>
>
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Samuel Gendler 2011-06-14 04:44:45 Re: Question about speed: Weird Behavior
Previous Message crramirez 2011-06-13 17:15:16 Re: ERROR : column c.reltriggers does not exist