-3

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.

enter image description here

4 Answers4

0

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.

Matheus Farias
  • 716
  • 1
  • 10
0

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()
Tito
  • 289
  • 8
0

Here are some steps:

1.

sudo -u postgres psql
  1. 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.

-1

you can use the \timing feature with psql to measure the execution time of a function from your extension.

Marcos Silva
  • 115
  • 5