Author malin
Recipients malin, methane, serhiy.storchaka, sir-sigurd
Date 2019-09-22.11:50:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
C type `long` is 4-byte integer in 64-bit Windows build. [1]

But `ucs1lib_find_max_char()` function [2] uses SIZEOF_LONG, so it loses a little performance in 64-bit Windows build.

Below is the benchmark of using SIZEOF_SIZE_T and this change:

    -   unsigned long value = *(unsigned long *) _p;
    +   sizt_t value = *(sizt_t *) _p;

D:\dev\cpython\PCbuild\amd64\python.exe -m pyperf timeit -s "b=b'a'*10_000_000; f=b.decode;" "f('latin1')"

    before: 5.83 ms +- 0.05 ms
    after : 5.58 ms +- 0.06 ms



Maybe there can be more optimizations, so I didn't prepare a PR for this.
Date User Action Args
2019-09-22 11:50:02malinsetrecipients: + malin, methane, serhiy.storchaka, sir-sigurd
2019-09-22 11:50:02malinsetmessageid: <>
2019-09-22 11:50:02malinlinkissue38252 messages
2019-09-22 11:50:01malincreate