diff options
author | 2024-02-29 03:18:21 +0100 | |
---|---|---|
committer | 2024-02-28 20:00:13 -0800 | |
commit | f12d5131b01a771e9dbd63705064f4b26f5a77d0 (patch) | |
tree | d1eeb2e9c69c72df11f540bc5ce99ce721520cb4 /internal/reader/readability/readability.go | |
parent | 1f5c8ce353e48b7eccb37d0d8f214cf24610957d (diff) | |
download | v2-f12d5131b01a771e9dbd63705064f4b26f5a77d0.tar.gz v2-f12d5131b01a771e9dbd63705064f4b26f5a77d0.tar.zst v2-f12d5131b01a771e9dbd63705064f4b26f5a77d0.zip |
Divide the sanitization time by 3
Instead of having to allocate a ~100 keys map containing possibly dynamic
values (at least to the go compiler), allocate it once in a global variable.
This significantly speeds things up, by reducing the garbage
collector/allocator involvements.
Local synthetic benchmarks have shown a improvements from 38% of wall time to only
12%.
Diffstat (limited to 'internal/reader/readability/readability.go')
0 files changed, 0 insertions, 0 deletions