Unix Technical Forum

Re: insert performance for win32

This is a discussion on Re: insert performance for win32 within the Pgsql Performance forums, part of the PostgreSQL category; --> ok, here is gprof output from newlines/no newlines [newlines] % cumulative self self total time seconds seconds calls s/call ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Performance

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 06:29 AM
Merlin Moncure
 
Posts: n/a
Default Re: insert performance for win32

ok, here is gprof output from newlines/no newlines
[newlines]
% cumulative self self total
time seconds seconds calls s/call s/call name
19.03 0.67 0.67 1 0.67 3.20 MainLoop
17.61 1.29 0.62 500031 0.00 0.00 yylex
15.63 1.84 0.55 1500094 0.00 0.00 GetVariable
11.08 2.23 0.39 250018 0.00 0.00 SendQuery
4.26 2.38 0.15 750051 0.00 0.00 GetVariableBool
3.41 2.50 0.12 250024 0.00 0.00 SetVariable
2.56 2.59 0.09 250015 0.00 0.00 gets_fromFile
2.27 2.67 0.08 750044 0.00 0.00
yy_switch_to_buffer
2.27 2.75 0.08 500031 0.00 0.00 psql_scan
2.27 2.83 0.08 pg_strcasecmp
1.70 2.89 0.06 4250078 0.00 0.00 emit
1.70 2.95 0.06 500031 0.00 0.00 VariableEquals
1.70 3.01 0.06 250018 0.00 0.00 AcceptResult
1.42 3.06 0.05 250018 0.00 0.00 ResetCancelConn

[no newlines]
% cumulative self self total
time seconds seconds calls s/call s/call name
23.01 0.26 0.26 250019 0.00 0.00 yylex
19.47 0.48 0.22 250018 0.00 0.00 SendQuery
11.50 0.61 0.13 1000070 0.00 0.00 GetVariable
9.73 0.72 0.11 250042 0.00 0.00 pg_strdup
9.73 0.83 0.11 250024 0.00 0.00 SetVariable
6.19 0.90 0.07 500039 0.00 0.00 GetVariableBool
5.31 0.96 0.06 pg_strcasecmp
4.42 1.01 0.05 4250078 0.00 0.00 emit
2.65 1.04 0.03 1 0.03 1.01 MainLoop

ok, mingw gprof is claiming MainLoop is a culprit here, along with
general efficiency penalty otherwise in several things (twice many calls
to yylex, 33%more to getvariable, etc). Just for fun I double checked
string len of query input to SendQuery and everything is the right
length.

Same # calls to SendQuery, but 2.5 times call time in newlines
case...anything jump out?

Merlin

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 06:29 AM
Tom Lane
 
Posts: n/a
Default Re: insert performance for win32

"Merlin Moncure" <merlin.moncure@rcsonline.com> writes:
> ok, mingw gprof is claiming MainLoop is a culprit here,


The only thing I can see that would be different for Windows is the
SetConsoleCtrlHandler kernel call ... could that be expensive? Why
do we have either sigsetjmp or setup_cancel_handler inside the per-line
loop, rather than just before it?

There is a lot of stuff in MainLoop that doesn't seem like it really
needs to be done on every single line, particularly not the repeated
fetching of psql variables that couldn't possibly change except inside
HandleSlashCmds. But that all ought to be the same on Unix or Windows.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 06:29 AM
Qingqing Zhou
 
Posts: n/a
Default Re: insert performance for win32


""Merlin Moncure"" <merlin.moncure@rcsonline.com> wrote
> ok, here is gprof output from newlines/no newlines
> [newlines]
> % cumulative self self total
> time seconds seconds calls s/call s/call name
> 19.03 0.67 0.67 1 0.67 3.20 MainLoop
> 17.61 1.29 0.62 500031 0.00 0.00 yylex
> 15.63 1.84 0.55 1500094 0.00 0.00 GetVariable
> 11.08 2.23 0.39 250018 0.00 0.00 SendQuery
> 4.26 2.38 0.15 750051 0.00 0.00 GetVariableBool
> 3.41 2.50 0.12 250024 0.00 0.00 SetVariable
> 2.56 2.59 0.09 250015 0.00 0.00 gets_fromFile
> 2.27 2.67 0.08 750044 0.00 0.00
> yy_switch_to_buffer
> 2.27 2.75 0.08 500031 0.00 0.00 psql_scan
> 2.27 2.83 0.08 pg_strcasecmp
> 1.70 2.89 0.06 4250078 0.00 0.00 emit
> 1.70 2.95 0.06 500031 0.00 0.00 VariableEquals
> 1.70 3.01 0.06 250018 0.00 0.00 AcceptResult
> 1.42 3.06 0.05 250018 0.00 0.00 ResetCancelConn
>


Maybe I missed some threads .... do you think it is interesting to test the
*absoulte* time difference of the same machine on Windows/Linux by using
timeit.c? I wonder if windows is slower than Linux ...

Regards,
Qingqing


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:02 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com