Presumably, the 50 msec difference represents the time to load up the perl library and initialize a perl interpreter.
It might help if libperl were to be preloaded into the postmaster in the
way you created ...
I tried that after I posted, but only saw roughly 30% improvement (which is consistent with my earlier tests IIRC). Not bad, but this still left plperl initial call at ~40 msec versus plpgsql at ~4 msec. It is possible that the initialization function that I used, plperl_init_all(), doesn't include everything it could. I might play around with it when I get a few moments.
Joe
---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match