Re: LLVM miscompiles numeric.c access to short numeric var headers

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: LLVM miscompiles numeric.c access to short numeric var headers
Дата
Msg-id CAM-w4HOwy3EfmR+kyT0DLnOnf9u3PhJMOwT-5gVDgM2Gmh8ucA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: LLVM miscompiles numeric.c access to short numeric var headers  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: LLVM miscompiles numeric.c access to short numeric var headers
Список pgsql-hackers
On Thu, Nov 12, 2015 at 3:51 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Meh.  The palloc to create an aligned array of digits would eat up
> any possible performance win --- it'd be just about as expensive
> as the existing unpack operation.

I suppose we would only need to palloc the digits if we found they
were unaligned which would only happen if the varlena header was
packed. So if the varlena header wasn't packed (or if we were just
lucky with the packed alignment which would happen half the time) we
could share the bytes from the packed varlena in the buffer directly
in the var.


> I think we could fix the immediate issue by redeclaring numeric
> headers as arrays of (u)int16 rather than structs.  I'm not
> very excited about the packed-header case.

That would require giving up the pretense that the code supports base
10 and base 100 I suppose. And would still be doing a palloc/memcpy
for data smaller than 128 bytes.

-- 
greg



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: LLVM miscompiles numeric.c access to short numeric var headers
Следующее
От: Matthijs van der Vleuten
Дата:
Сообщение: Re: psql: add \pset true/false