plx benchmark (PostgreSQL 18.4, min of 5 runs) workload sizes: arith=2000000 strbuild=200000 iter=1000000 rows branch=2000000 call=500000 (perl/py call=50000) language arith strbuild iter branch call ------------------------------------------------------------------------------------------ plpgsql 48 ms (1.00x) 1597 ms (1.00x) 88 ms (1.00x) 150 ms (1.00x) 145 ms (1.00x) plxruby 50 ms (1.06x) 9 ms (0.01x) 97 ms (1.10x) 153 ms (1.02x) 151 ms (1.05x) plxphp 52 ms (1.09x) 9 ms (0.01x) 99 ms (1.11x) 154 ms (1.02x) 149 ms (1.03x) plxjs 51 ms (1.07x) 10 ms (0.01x) 94 ms (1.06x) 154 ms (1.03x) 153 ms (1.06x) plxpython3 53 ms (1.12x) 10 ms (0.01x) 99 ms (1.12x) 154 ms (1.03x) 149 ms (1.03x) plperl 42 ms (0.88x) 12 ms (0.01x) 507 ms (5.74x) 139 ms (0.93x) 273 ms (1.89x) plpython3u 64 ms (1.35x) 14 ms (0.01x) 337 ms (3.81x) 108 ms (0.72x) 165 ms (1.14x) x = relative to plpgsql (lower is faster). plx dialects transpile to plpgsql. Note: perl/python 'call' uses 1/10 the iterations (per-call SPI is far slower).