nuke/internal
Jason Cameron 2904ff974b
refactor(ogtags): optimize URL construction and memory allocations (#647)
* refactor(ogtags): optimize URL construction and memory allocations

* test(ogtags): add benchmarks and memory usage tests for OGTagCache

* refactor(ogtags): optimize OGTags subsystem to reduce allocations and improve request runtime by up to 66%

* Update docs/docs/CHANGELOG.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jason Cameron <jasoncameron.all@gmail.com>

* refactor(ogtags): optimize URL string construction to reduce allocations

* Update internal/ogtags/ogtags.go

Co-authored-by: Xe Iaso <me@xeiaso.net>
Signed-off-by: Jason Cameron <jasoncameron.all@gmail.com>

* test(ogtags): add fuzz tests for getTarget and extractOGTags functions

* fix(ogtags): update memory calculation logic

Prev it would say that we had allocated 18pb

=== RUN   TestMemoryUsage
    mem_test.go:107: Memory allocated for 10k getTarget calls: 18014398509481904.00 KB
    mem_test.go:135: Memory allocated for 1k extractOGTags calls: 18014398509481978.00

    Now it's fixed with

    === RUN   TestMemoryUsage
    mem_test.go:109: Memory allocated for 10k getTarget calls:
    mem_test.go:110:   Total: 630.56 KB (0.62 MB)
    mem_test.go:111:   Per operation: 64.57 bytes
    mem_test.go:140: Memory allocated for 1k extractOGTags calls:
    mem_test.go:141:   Total: 328.17 KB (0.32 MB)
    mem_test.go:142:   Per operation: 336.05 bytes

* refactor(ogtags): optimize meta tag extraction for improved performance

* Update metadata

check-spelling run (pull_request) for json/ogmem

Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com>
on-behalf-of: @check-spelling <check-spelling-bot@check-spelling.dev>

* chore: update CHANGELOG for recent optimizations and version bump

* refactor: improve URL construction and meta tag extraction logic

* style:  cleanup fuzz tests

---------

Signed-off-by: Jason Cameron <jasoncameron.all@gmail.com>
Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com>
Signed-off-by: Jason Cameron <git@jasoncameron.dev>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Xe Iaso <me@xeiaso.net>
2025-06-13 09:53:10 -04:00
..
dnsbl Refactor and split out things into cmd and lib (#77) 2025-03-22 18:44:49 -04:00
ogtags refactor(ogtags): optimize URL construction and memory allocations (#647) 2025-06-13 09:53:10 -04:00
test fix(internal/test): skip integration tests if SKIP_INTEGRATION is set (#586) 2025-05-30 00:49:53 +00:00
gzip.go feat(lib): ensure that clients store cookies (#501) 2025-05-16 13:03:40 -04:00
hash.go Refactor and split out things into cmd and lib (#77) 2025-03-22 18:44:49 -04:00
headers.go Adds ability to toggle off stripping of private addrs from XFF (#619) 2025-06-09 13:33:19 +00:00
log.go feat(log): implement custom error log filter to suppress "context can… (#470) 2025-05-07 23:28:50 -04:00
log_test.go feat(log): implement custom error log filter to suppress "context can… (#470) 2025-05-07 23:28:50 -04:00
mimetype.go fix(internal): register mime type for .mjs files (#577) 2025-05-28 13:52:48 +00:00
xff_test.go Adds ability to toggle off stripping of private addrs from XFF (#619) 2025-06-09 13:33:19 +00:00