> On 14 Dec 2023, at 14:28, tender wang <tndrw...@gmail.com> wrote: > > Now that AND is more faster, Can we replace the '% SLRU_MAX_BANKLOCKS' > operation in SimpleLruGetBankLock() with '& 127' unsigned int GetBankno1(unsigned int pageno) { return pageno & 127; } unsigned int GetBankno2(unsigned int pageno) { return pageno % 128; } Generates with -O2 GetBankno1(unsigned int): mov eax, edi and eax, 127 ret GetBankno2(unsigned int): mov eax, edi and eax, 127 ret Compiler is smart enough with constants. Best regards, Andrey Borodin.
- Re: SLRU optimization - configurable bu... Andrey M. Borodin
- Re: SLRU optimization - configurab... Dilip Kumar
- Re: SLRU optimization - config... Dilip Kumar
- Re: SLRU optimization - config... Dilip Kumar
- Re: SLRU optimization - config... tender wang
- Re: SLRU optimization - config... Alvaro Herrera
- Re: SLRU optimization - config... Dilip Kumar
- Re: SLRU optimization - config... Amul Sul
- Re: SLRU optimization - config... Andrey M. Borodin
- Re: SLRU optimization - config... tender wang
- Re: SLRU optimization - config... Andrey M. Borodin
- Re: SLRU optimization - config... tender wang
- Re: SLRU optimization - config... Andrey M. Borodin
- Re: SLRU optimization - configurable buffer... Andrey M. Borodin
- Re: SLRU optimization - configurable bu... Dilip Kumar
- Re: SLRU optimization - configurable buffer pool and par... Alvaro Herrera
- Re: SLRU optimization - configurable buffer pool an... Dilip Kumar
- Re: SLRU optimization - configurable buffer poo... Alvaro Herrera
- Re: SLRU optimization - configurable buffer pool and par... Alvaro Herrera
- Re: SLRU optimization - configurable buffer pool an... Dilip Kumar
- Re: SLRU optimization - configurable buffer pool an... Andrey M. Borodin