Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> Drilling into the profile, I came up with three little optimizations:
> 1. Within spgdoinsert, a significant portion of the CPU time is spent on
> line 2033 in spgdoinsert.c:
> memset(&out, 0, sizeof(out));
> That zeroes out a small struct allocated in the stack. Replacing that
> with MemSet() makes it faster, reducing the time spent on zeroing that
> struct from 10% to 1.5% of the time spent in spgdoinsert(). That's not
> very much in the big scheme of things, but it's a trivial change so
> seems worth it.
Fascinating. I'd been of the opinion that modern compilers would inline
memset() for themselves and MemSet was probably not better than what the
compiler could do these days. What platform are you testing on?
The other two changes seem reasonable.
regards, tom lane