downloader: avoid redundant Share.loop calls #1186
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#1186
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In #1170 (c92)#comment:92 I mentioned a performance problem in which the downloader (specifically
Share._got_response
) queues a new call toShare.loop
for each message received (which is linear with the number of segments, roughly k3numsegs total). Given the way that messages arrive in the pipeline, most of these calls have no work to do, and each one takes about 250us on my laptop. In a purely local download (running at 4.4MBps), this wastes about 8% of the download time.The fix is to set a flag when the loop needs to be run, queue a call if-and-only-iff the flag was not already set, and clear the flag when the loop is run.
I think you mean [ShareFinder._got_response]source:trunk/src/allmydata/immutable/downloader/finder.py@4707#L89#L167 instead of
Share._got_response
. Let's see, how does it triggerShareFinder.loop
? It calls [ShareFinder._deliver_shares]source:trunk/src/allmydata/immutable/downloader/finder.py@4707#L89#L217 which eventually calls [DownloadNode.got_shares]source:trunk/src/allmydata/immutable/downloader/node.py@4707#L222 which calls [SegmentFetcher.add_shares]source:trunk/src/allmydata/immutable/downloader/fetcher.py@4707#L65 which eventually calls [SegmentFetcher.loop]source:trunk/src/allmydata/immutable/downloader/fetcher.py@4707#L80.Nope,
ShareFinder
does the DYHB queries, so it's only involved once at the beginning of the download. It looks like I really meantShare._got_data
, which is called multiple times per fetched block: one for the block data itself, another couple times for hashes, made worse by the fact that we're doing independent (although pipelined) foolscapremote_read()
s, since we don't have an immutablereadv
storage API.But it turns out that this is a dup: #1268 is the real ticket, and it was fixed in changeset:c9def7697757bdae.