Actually I have created all the extensions following this manual but I have no idea how to perform Performance Benchmarking.
Can anyone step by step guide through that?
Thank you.
Actually I have created all the extensions following this manual but I have no idea how to perform Performance Benchmarking.
Can anyone step by step guide through that?
Thank you.
I think this performance benchmark is done by comparing the time that it takes for each method. So, I guess enabling the time
with \timing on
, you'll see how much time it takes for the query to perform.
The examples shown already shows how to carry this out.
You would have to enable time
before running it with psql
to check the performance which is in this case is how long it takes to execute.
It should be like so:
time psql the_func_in_ext()
Here are some steps:
1.
sudo -u postgres psql
CREATE FUNCTION addmepl(a integer, b integer) RETURNS integer as $$ BEGIN return a+b; END; $$ LANGUAGE plpgsql;
\q
time psql postgres -c "select floor(random() * (100-1+1) + 1)::int+g from generate_series(1,1000000) as g" > out1.txt
time psql postgres -c "select addme(floor(random() * (100-1+1) + 1)::int,g) from generate_series(1,1000000) as g" > out2.txt
time psql postgres -c "select addmepl(floor(random() * (100-1+1) + 1)::int,g) from generate_series(1,1000000) as g" > out3.txt
These are some steps that will help you in performing performance benchmarking.
I hope this answers your question.
you can use the \timing feature with psql to measure the execution time of a function from your extension.