Skip to content

Read Magic-Folder API port from api_client_endpoint file#416

Merged
crwood merged 18 commits into
masterfrom
412.magic-folder-api-port
Dec 5, 2021
Merged

Read Magic-Folder API port from api_client_endpoint file#416
crwood merged 18 commits into
masterfrom
412.magic-folder-api-port

Conversation

@crwood

@crwood crwood commented Dec 5, 2021

Copy link
Copy Markdown
Member

Fixes #412.

Due to the Python interpreter's notoriously slow start up time, I opted to read/parse the Magic-Folder API port directly from the api_client_endpoint file (added by tahoe-lafs/magic-folder#593) rather than calling and parsing the output of the magic-folder show-config subcommand. On my modest system, the amount of time saved by not shelling out to magic-folder ends up being quite significant:

% time magic-folder show-config > /dev/null            
magic-folder show-config > /dev/null  0.71s user 0.08s system 98% cpu 0.804 total
% time cat .magic-folder/api_client_endpoint > /dev/null
cat .magic-folder/api_client_endpoint > /dev/null  0.00s user 0.00s system 77% cpu 0.001 total

@crwood crwood merged commit fbe3a46 into master Dec 5, 2021
@crwood crwood deleted the 412.magic-folder-api-port branch December 5, 2021 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gridsync parses stdout in order to determine the Magic-Folder API client endpoint

1 participant