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.
Perceived-latency P1: ETag/304, deferred tab fetches, lazy widgets #28014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Perceived-latency P1: ETag/304, deferred tab fetches, lazy widgets #28014
Changes from 17 commits
7251661aed45a1101a972f6654fc5ab52763782a0cc515580d825f3d4775d7145c97303f03ee194e5062a9efde083085e425d79b0f09f0407f400777577c565de535da6b17a4ff9cdbf9a76d5cafbfd4b6152d8ff5bac95c9942c25d265391c7db211ed5c1f338a5e667807227bb952a325f4945e4d0858f6fb85ab69e6ec00a21eca0d22304262ac96e5f2fce0a94b5efeaff5813998916f19804494c71131cb5d2e5fd0ab45e764d2532ee0a0fa777f19687bd1892a76a1ea050d5f751288b855be6159834fad9a1c80d64901a4dd1aad64cd87371368c49e44fd8a2297b0b98c9eb16bc3f9eFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In both
getEntityActivityByIdandgetEntityActivityByFqn, thecountByEntityquery now runs unconditionally (lines 190-191, 248-249), even when the caller passes a non-zero limit. Previouslytotalwas justevents.size()— zero extra DB round-trips. Now every normal activity-list request pays an additionalCOUNT(*)query againstactivity_streamjust to populatepaging.total.For the
limit=0(badge-only) path this is correct and efficient. But for the full-list path (Activity Feed tab open, default limit=50), the extra COUNT is wasted work — the caller already has the rows and the oldevents.size()was sufficient for paginating a capped result set.On high-activity entities or under load this doubles the DB cost of the endpoint for no user-visible benefit on the full-list path.
Only run the COUNT query when limit=0; for normal requests use events.size() as before.:
Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.