Skip to content

Conversation

@bwesterb
Copy link
Owner

Also deduplicate assertion requests.

Closes #40

Before merging this, we need to check whether it performs well.

Also deduplicate assertion requests.

Closes #40
@bwesterb
Copy link
Owner Author

Old:

bas@Mac ~/scm/mtc/cmd/mtc $ ./mtc ca -p data new -b 5m -l 2h 123 localhost:8080
bas@Mac ~/scm/mtc/cmd/mtc $ time ./mtc ca -p data queue -d example.com --debug-vary --debug-repeat 1000000 --tls-pem p256.pub
./mtc ca -p data queue -d example.com --debug-vary --debug-repeat 1000000    4.44s user 0.49s system 120% cpu 4.091 total
bas@Mac ~/scm/mtc/cmd/mtc $ time ./mtc ca -p data issue 
2025/04/23 13:57:54 INFO Starting issuance time=2025-04-23T11:57:54.294Z
2025/04/23 13:57:54 INFO Current state expectedStored=0 expectedActive=0 existingBatches=⌀
2025/04/23 13:57:54 INFO To issue batches=0
./mtc ca -p data issue  16.46s user 0.69s system 102% cpu 16.741 total

New:

bas@Mac ~/scm/mtc/cmd/mtc $ ./mtc ca -p data new -b 5m -l 2h 123 localhost:8080
bas@Mac ~/scm/mtc/cmd/mtc $ time ./mtc ca -p data queue -d example.com --debug-vary --debug-repeat 1000000 --tls-pem p256.pub
./mtc ca -p data queue -d example.com --debug-vary --debug-repeat 1000000    12.25s user 8.82s system 58% cpu 36.294 total
bas@Mac ~/scm/mtc/cmd/mtc $ time ./mtc ca -p data issue                                            
2025/04/23 13:55:17 INFO Starting issuance time=2025-04-23T11:55:17.915Z
2025/04/23 13:55:17 INFO Current state expectedStored=0 expectedActive=0 existingBatches=⌀
2025/04/23 13:55:17 INFO To issue batches=0
./mtc ca -p data issue  16.12s user 0.58s system 102% cpu 16.324 total

Quite a regression on queuing time.

@bwesterb
Copy link
Owner Author

bwesterb commented Apr 23, 2025

Part of the queueing regression is looking up whether there is an existing assertion, but mostly it seems to be the overhead for committing the transaction (which is done about 1000 times in this example, as the batch size is 1024).

CPU profile:

Copy link
Collaborator

@lukevalenta lukevalenta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performance regression aside, the code looks good.

Co-authored-by: Luke Valenta <lvalenta@cloudflare.com>
@bwesterb bwesterb merged commit d007153 into main Apr 23, 2025
1 check passed
@bwesterb bwesterb deleted the issue-40 branch April 23, 2025 12:37
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.

Deduplicate queued assertions

3 participants