Repository navigation
[pull] main from miniflux:main - #305
Merged
Merged
Conversation
…credentials The metrics Basic Auth check used != for username and password, which is technically vulnerable to timing side-channel attacks. Since the metrics credentials are typically short static config values, the timing difference is very likely to be in the noise level, but oh well, it's a good practise to do credential validation in constant time.
parseLocalTimeDates is called once per parsed feed entry. Each call to
time.LoadLocation("America/Los_Angeles" | "America/New_York") reads and
parses the IANA tzdata file from disk or from the embedded zoneinfo.
This commit hoists the two LoadLocation calls to package-level vars so the
lookup happens once at init time and the hot path becomes a pointer load.
Benchmarked on the local-time fallback path:
before: ~24,000 ns/op, ~15 KB/op, 26 allocs/op
after: ~330 ns/op, 0 B/op, 0 allocs/op
- No need to use `make(…)` construct for empty slices, as is already the case in the rest of internal/googlereader/handler.go - Replace a useless condition in internal/reader/sanitizer/sanitizer.go with an unconditional assignment. - Remove a useless call to url.Parse in JoinBaseURLAndPath, as url.JoinPath already performs the validation internally
…paths
findSubscriptionsFromWellKnownURLs iterates a fixed table of 9 well-known
feed paths against the discovered base URLs. The table was declared as a
map[string]string, which paid per-iteration hash overhead and gave
non-deterministic probe order across runs.
This commit replaces it with a fixed-size [...]struct{path, format string}.
Probes now run in declared order (more predictable behavior for users when
multiple well-known URLs respond, and easier to reason about in tests), and the
inner loop avoids the map iterator entirely.
Micro-benchmark replaying the double loop body against 2 base URLs ×
9 paths, sans HTTP I/O (medians of 5 runs):
name old ns/op new ns/op delta
KnownURLs 24,194 18,150 -25%
name old B/op new B/op delta
KnownURLs 9,688 9,072 -6.4%
name old allocs/op new allocs/op delta
KnownURLs 110 107 -3
This reverts commit deef74e.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )