-
Notifications
You must be signed in to change notification settings - Fork 210
Add compression for uploaded documentation #780
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
Merged
Merged
Changes from 11 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
b4c1a28
Add compression for uploaded documentation
jyn514 5c7d2ee
Remove commented-out code
jyn514 f735e85
Add test for compression
jyn514 de4965e
Add benchmark for compression/decompression
jyn514 1133541
zstd 5 -> zstd 9
jyn514 256452d
Make compression an enum instead of a boolean
jyn514 6b1a7c9
Add compression algorithms to database
jyn514 6433902
Fix tests
jyn514 d72ffe3
Fix compression when uploading to database backend
jyn514 189e6cd
Cleanup
jyn514 9b5d200
Fix downgrade queries
jyn514 ddfb0d6
Make compression algorithms more extensible
jyn514 8f6051f
Fix outdated SQL
jyn514 869a36b
Use macro-based enum for extensibility
jyn514 33eee9b
Don't give an error when rebuilding documentation
jyn514 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use cratesfyi::storage::{compress, decompress}; | ||
use criterion::{black_box, criterion_group, criterion_main, Criterion}; | ||
|
||
pub fn criterion_benchmark(c: &mut Criterion) { | ||
// this isn't a great benchmark because it only tests on one file | ||
// ideally we would build a whole crate and compress each file, taking the average | ||
let html = std::fs::read_to_string("benches/struct.CaptureMatches.html").unwrap(); | ||
let html_slice = html.as_bytes(); | ||
c.bench_function("compress regex html", |b| { | ||
b.iter(|| compress(black_box(html_slice))) | ||
}); | ||
let (compressed, alg) = compress(html_slice).unwrap(); | ||
c.bench_function("decompress regex html", |b| { | ||
b.iter(|| decompress(black_box(compressed.as_slice()), alg)) | ||
}); | ||
} | ||
|
||
criterion_group!(compression, criterion_benchmark); | ||
criterion_main!(compression); |
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.