Repository navigation
Conversation
…gress bar Next was slow because every page asked cvcpkg.org for facets, which makes it count every match: 1.2 s for page 2 of everything and 2.4 s for page 2 of zlib, against 0.2 s and 0.4 s without. Now only a new query or filter asks for facets (the honest package count); paging reuses that count. After showing a page the search module prefetches the next one in the background and keeps the page it left, so Next and Prev are answered with no request. Requests wait in 50 ms slices (http-get-async and await with a timeout), and between slices the module draws an indeterminate progress bar at the bottom of its view; the package module does too. lib.ari gains search-key, body-text and progress-bar, and search-query takes facets. The fixture logs its requests (/_requests) and answers a slow: name after a second. Module tests show a new query asks for facets and paging doesn't, Next and Prev make no request, and the bar draws during a slow request and clears after; with prefetch disabled they fail.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Next felt slow. The cause was the server, not the UI: every page asked cvcpkg.org for
facets=true, which makes it count every match. Measured on cvcpkg.org (time to first byte):Changes
http-get-asyncand(await f 0.05)in a loop. Between slices the module draws an indeterminate bar at the bottom of its view; the package module does the same when opening a package. The tick is parked, not blocked, so frames keep drawing.search-key,body-textandprogress-bar(three slices of a constant, cheap enough to redraw 20 times a second).search-querytakesfacets.Tests
/_requests, and answers aslow:name after a second.tests/run.shpasses every layer, including 3d (the integration tests against a real cvcpkg-server). The browser test passes too.In the browser
In the single-threaded wasm page, network calls still block until the reply arrives, so the bar can't animate there. The prefetch also holds the first frame for one more request: first results took 5.2 s locally, against 3.7 s. The libcvc session working on async fetch in single-threaded wasm (L4) removes that, with no change needed here.