1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-06 17:41:00 +00:00
miniflux-v2/internal/reader/readability
jvoisin 2f7b2e7375 perf(readability): improve getLinkDensity
- There is no need to materialize all the content of a given Node when we can
  simply compute its length directly, saving a lot of memory, on the order of
  several megabytes on my instance, with peaks at a couple of dozen.
- One might object to the usage of a recursive construct, but this is a direct
  port of goquery's Text method, so this change doesn't make anything worse.
- The computation of linkLength can be similarly computed, but this can go in
  another commit, as it's a bit trickier, since we need to get the length of
  every Node that has a `a` Node as parent, without iterating on the whole
  parent chain every time.
2025-07-01 19:40:47 -07:00
..
readability.go perf(readability): improve getLinkDensity 2025-07-01 19:40:47 -07:00
readability_test.go perf(readability): improve getLinkDensity 2025-07-01 19:40:47 -07:00
testdata Refactor internal/reader/readability/testdata 2024-12-15 20:52:32 -08:00