-
Notifications
You must be signed in to change notification settings - Fork 165
Faster mcap recover CLI command
#1372
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
Conversation
|
Hi @mrkbac - thanks for your contribution, this is a really nice idea. I don't think it makes sense to keep this as a separate subcommand - "appropriate" could be considered as any MCAP containing both chunk and message indexes, where no chunk contains unknown channels. I'd be in favor of making this the default behavior, and adding a |
|
Hey @james-rms I've update the PR and replace There are a few differences to the original
|
|
There's a lot here - i have a few comments but it's hard to parse out which changes depend on them. could you pull the changes for |
|
Sure, I've removed them from here. Let me know if I should change anything else. |
Legend. Is there a separate PR open for this? |
|
Not yet I removed it from here to keep this PR focused. I'll try to open one today or tomorrow |
Changelog
Updates
recoverCLI command, which does not decompress all the chunks making it 4x - 27x fasterDescription
This PR updates the `recover' command.
It does not decompress the chunks and copies them as is, only decompressing them if they contain unknown channels.
If the last message in the mcap is a message index, the last chunk will also be decompressed and the message indexes recreated ensuring no indexes are missing.
This makes it 4x - 27x faster than the regular command.
Benchmarks (MacBook Pro M1):
300MB File:
hyperfine \ --warmup 2 \ --runs 10 \ 'go run cli/mcap/main.go recover 300MB.mcap -o /dev/null' \ 'mcap recover 300MB.mcap -o /dev/null' Benchmark 1: go run cli/mcap/main.go recover 300MB.mcap -o /dev/null Time (mean ± σ): 496.2 ms ± 9.1 ms [User: 435.7 ms, System: 2779.0 ms] Range (min … max): 477.2 ms … 513.6 ms 10 runs Benchmark 2: mcap recover 300MB.mcap -o /dev/null Time (mean ± σ): 2.170 s ± 0.026 s [User: 3.226 s, System: 2.814 s] Range (min … max): 2.134 s … 2.213 s 10 runs Summary go run cli/mcap/main.go recover 300MB.mcap -o /dev/null ran 4.37 ± 0.10 times faster than mcap recover 300MB.mcap -o /dev/null19GB File
This PR also introduces,
mcap infosupport on unindexed mcaps andmcap recover-in-place