RE: Big Performance drop of Exceptions in UDFs between V11.2 and 13.4

From: "ldh(at)laurent-hasson(dot)com" <ldh(at)laurent-hasson(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: RE: Big Performance drop of Exceptions in UDFs between V11.2 and 13.4
Date: 2021-08-22 21:12:43
Message-ID: MN2PR15MB2560F5ABDE7BE85C11625AFD85C39@MN2PR15MB2560.namprd15.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> -----Original Message-----
> From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
> Sent: Sunday, August 22, 2021 16:11
> To: ldh(at)laurent-hasson(dot)com
> Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>; Ranier Vilela
> <ranier(dot)vf(at)gmail(dot)com>; pgsql-performance(at)postgresql(dot)org
> Subject: Re: Big Performance drop of Exceptions in UDFs between V11.2
> and 13.4
>
> "ldh(at)laurent-hasson(dot)com" <ldh(at)laurent-hasson(dot)com> writes:
> > I do have a Linux install of 13.3, and things work beautifully, so this is
> definitely a Windows thing here that started in V12.
>
> It's good to have a box around it, but that's still a pretty large box :-(.
>
> I'm hoping that one of our Windows-using developers will see if they can
> reproduce this, and if so, try to bisect where it started.
> Not sure how to make further progress without that.
>
> regards, tom lane

Hello Tom,

If there is any way I can help further... I am definitely not able to do a dev environment and local build, but if we have a windows developer reproducing the issue between 11 and 12, then that should help. If someone makes a debug build available to me, I can provide additional help based on that.

That being said, do you have any suggestion how I could circumvent the issue altogether? Is there a way I could convert a String to some type (integer, float, date...) without exceptions and in case of failure, return a default value? Maybe there is a way to do this and I can avoid exception handling altogether? Or use something else than plpgsql? I am always under the impression that plpgsql is the best performing option?

I have seen regex-based options out there, but none being fully satisfying for floating points in particular.

Thank you,
Laurent.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Andrew Dunstan 2021-08-22 21:26:30 Re: Big Performance drop of Exceptions in UDFs between V11.2 and 13.4
Previous Message Tom Lane 2021-08-22 20:11:25 Re: Big Performance drop of Exceptions in UDFs between V11.2 and 13.4