diff options
| author | Guan-Chun Wu <409411716@gms.tku.edu.tw> | 2026-05-31 16:00:19 +0800 |
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2026-06-03 10:30:15 -0400 |
| commit | 3ca1d19c1971ac4f25478eafb741e726bf2d5954 (patch) | |
| tree | e46c7391744c6d29e040cf3fce9bb27f57c5c217 /drivers/phy/eswin/git@git.tavy.me:linux.git | |
| parent | 3147cac6c1929f26b4687993b8c7af5b7b34496d (diff) | |
ext4: improve str2hashbuf by processing 4-byte chunks and removing function pointers
The original byte-by-byte implementation with modulo checks is less
efficient. Refactor str2hashbuf_unsigned() and str2hashbuf_signed()
to process input in explicit 4-byte chunks instead of using a
modulus-based loop to emit words byte by byte.
Additionally, the use of function pointers for selecting the appropriate
str2hashbuf implementation has been removed. Instead, the functions are
directly invoked based on the hash type, eliminating the overhead of
dynamic function calls.
Performance test (x86_64, Intel Core i7-10700 @ 2.90GHz, average over 10000
runs, using kernel module for testing):
len | orig_s | new_s | orig_u | new_u
----+--------+-------+--------+-------
1 | 70 | 71 | 63 | 63
8 | 68 | 64 | 64 | 62
32 | 75 | 70 | 75 | 63
64 | 96 | 71 | 100 | 68
255 | 192 | 108 | 187 | 84
This change improves performance, especially for larger input sizes.
Signed-off-by: Guan-Chun Wu <409411716@gms.tku.edu.tw>
Link: https://patch.msgid.link/20260531080019.3794809-3-409411716@gms.tku.edu.tw
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'drivers/phy/eswin/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
