Remove unnecessary memcpy when reading WAL record fitting on page
Michael Paquier <michael@paquier.xyz>
Remove unnecessary memcpy when reading WAL record fitting on page When reading a WAL record, its contents are copied into an intermediate buffer. However, doing so is not necessary if the record fits fully into the current page, saving one memcpy for each such record. The allocation handling of the intermediate buffer is also now done only when a record crosses a page boundary, shaving some extra cycles when reading a WAL record. Author: Andrey Lepikhov Reviewed-by: Kyotaro Horiguchi, Heikki Linnakangas Discussion: https://postgr.es/m/c2ea54dd-a1d3-80eb-ddbf-7e6f258e615e@postgrespro.ru
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/transam/xlog.c | modified | +0 −3 |
| src/backend/access/transam/xlogreader.c | modified | +13 −14 |
Discussion
- [PATCH] XLogReadRecord returns pointer to currently read page 18 messages · 2018-08-17 → 2018-11-20