Sujet : Re: FreeTDS port to VMS V9.x on x86?
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vmsDate : 25. Jun 2025, 01:38:57
Autres entêtes
Organisation : SunSITE.dk - Supporting Open source
Message-ID : <685b4521$0$693$14726298@news.sunsite.dk>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
User-Agent : Mozilla Thunderbird
On 6/24/2025 12:25 PM, Arne Vajhøj wrote:
I don't like the #elif HAVE_VSNPRINTF code in tds_vasprintf.
:-)
The algorithm is basically to try vsnprintf with buffers
increasing in size 512, 1024, 1536, ... until there is space.
That is very inefficient compared to just use the return value.
And since it does not use va_copy, then only the first call to
vsnprintf will work.
Even if va_copy was called and we ignore the option of
using vsnprintf return value, then +512 is not good
compared to *2. +512 with a 1 GB CLOB value would mean
2 million calls to vsnprintf.
(I have not checked if TDS actually allow that long
statements, but +512 is a problem)
Arne