overhead of expression evaluation

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: overhead of expression evaluation
Date: 2018-05-17 09:32:16
Message-ID: CAFj8pRDMJh0nPW8vLvr3Gp5Nm+jyd6fKanA5Bpq50FzaL3ScWA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

just for curiosity - I tested simple script

postgres=# do
$$
declare s bigint = 0;
begin
for i in 1..1000000000 loop
s := s + i;
end loop;
raise notice '%', s;
end;
$$;

to see a overhead of some components

5,72% plpgsql.so [.] exec_assign_value
5,59% postgres [.] GetSnapshotData
4,94% plpgsql.so [.] exec_eval_simple_expr
4,84% postgres [.] AllocSetAlloc
3,61% postgres [.]
ResourceOwnerForgetPlanCacheRef
2,95% postgres [.] choose_custom_plan
2,94% postgres [.] GetUserId
2,92% postgres [.] GetCachedPlan
2,87% postgres [.] LWLockAttemptLock
2,85% postgres [.] memset(at)plt
2,76% postgres [.] LWLockRelease
2,70% postgres [.] AllocSetFree
2,42% plpgsql.so [.] assign_simple_var
2,36% postgres [.] ExecInterpExpr
2,35% postgres [.] PopActiveSnapshot
2,27% postgres [.]
OverrideSearchPathMatchesCurrent
2,22% plpgsql.so [.] plpgsql_param_eval_var
2,21% plpgsql.so [.] exec_stmt
1,89% libc-2.27.so [.]
__memset_sse2_unaligned_erms
1,75% postgres [.] PushActiveSnapshot
1,74% postgres [.] AcquireExecutorLocks
1,67% postgres [.] CopySnapshot
1,64% postgres [.] CheckCachedPlan
1,56% postgres [.] RevalidateCachedQuery
1,55% postgres [.] MemoryContextAlloc
1,53% postgres [.] pfree
1,50% postgres [.] ResourceArrayRemove
1,43% postgres [.] LWLockAcquire
1,40% postgres [.]
SPI_plan_get_cached_plan

Regards

Pavel

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Huong Dangminh 2018-05-17 09:51:31 RE: NaNs in numeric_power (was Re: Postgres 11 release notes)
Previous Message Konstantin Knizhnik 2018-05-17 09:31:09 Re: Possible bug in logical replication.