mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-11-10 06:34:18 +00:00
Benches: Switch to using real-world assets
This commit is contained in:
parent
776c7dadcb
commit
af3b98d441
15 changed files with 59 additions and 15 deletions
39
benches/README.md
Normal file
39
benches/README.md
Normal file
|
@ -0,0 +1,39 @@
|
|||
# Benchmarks
|
||||
|
||||
There are two categories of benchmarks here:
|
||||
* File parsing for each of the supported file formats
|
||||
* Tag creation for each of the supported tag formats
|
||||
|
||||
## File parsing
|
||||
|
||||
The file parsing benchmarks are run on a set of assets that attempt to be representative of
|
||||
files one would find in the wild.
|
||||
|
||||
The song used is "TempleOS Hymn Risen (Remix)" by Dave Eddy, licensed under Public Domain.
|
||||
|
||||
Links to the song:
|
||||
* [YouTube](https://www.youtube.com/watch?v=IdYMA6hY_74)
|
||||
* [Bandcamp](https://daveeddy.bandcamp.com/track/templeos-hymn-risen-remix)
|
||||
* [Creator's site](https://music.daveeddy.com/tracks/templeos-hymn-risen-remix/)
|
||||
|
||||
The file was originally provided as a FLAC, and has been re-encoded to the other formats.
|
||||
|
||||
Some conditions:
|
||||
|
||||
* Each file will only make use of their ["primary tag"](https://docs.rs/lofty/latest/lofty/enum.FileType.html#method.primary_tag_type).
|
||||
* The following fields are used (with some possibly left out, depending on the format):
|
||||
* Title
|
||||
* Artist
|
||||
* Album
|
||||
* Date
|
||||
* Track number
|
||||
* Genre
|
||||
* Picture (Front cover)
|
||||
* Encoder
|
||||
|
||||
### Tag creation
|
||||
|
||||
The tag creation benchmarks will only create the tags and dump them to a writer,
|
||||
this will not take into account the time it takes to write the tags to a file.
|
||||
|
||||
The tags will be created using the same conditions as above, with the exact same data as present in the files.
|
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).aac
Normal file
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).aac
Normal file
Binary file not shown.
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).aiff
Normal file
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).aiff
Normal file
Binary file not shown.
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).ape
Normal file
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).ape
Normal file
Binary file not shown.
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).flac
Normal file
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).flac
Normal file
Binary file not shown.
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).m4a
Normal file
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).m4a
Normal file
Binary file not shown.
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).mp3
Normal file
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).mp3
Normal file
Binary file not shown.
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).mpc
Normal file
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).mpc
Normal file
Binary file not shown.
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).ogg
Normal file
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).ogg
Normal file
Binary file not shown.
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).opus
Normal file
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).opus
Normal file
Binary file not shown.
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).spx
Normal file
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).spx
Normal file
Binary file not shown.
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).wav
Normal file
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).wav
Normal file
Binary file not shown.
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).wv
Normal file
BIN
benches/assets/01 TempleOS Hymn Risen (Remix).wv
Normal file
Binary file not shown.
|
@ -20,9 +20,14 @@ macro_rules! bench_tag_write {
|
|||
let mut v = Vec::new();
|
||||
let mut tag = <$tag>::default();
|
||||
|
||||
tag.set_artist(String::from("Foo artist"));
|
||||
tag.set_title(String::from("Bar title"));
|
||||
tag.set_album(String::from("Baz album"));
|
||||
tag.set_artist(String::from("Dave Eddy"));
|
||||
tag.set_title(String::from("TempleOS Hymn Risen (Remix)"));
|
||||
tag.set_album(String::from("Summer"));
|
||||
tag.set_year(2017);
|
||||
tag.set_track_number(1);
|
||||
tag.set_genre(String::from("Electronic"));
|
||||
// TODO: Front cover
|
||||
// TODO: Encoder
|
||||
tag.dump_to(&mut v).unwrap();
|
||||
})
|
||||
);
|
||||
|
|
|
@ -30,18 +30,18 @@ fn content_infer_read(c: &mut Criterion) {
|
|||
test_read_file!(
|
||||
c,
|
||||
[
|
||||
(AAC, "../tests/files/assets/minimal/full_test.aac"),
|
||||
(AIFF, "../tests/files/assets/minimal/full_test.aiff"),
|
||||
(APE, "../tests/files/assets/minimal/full_test.ape"),
|
||||
(FLAC, "../tests/files/assets/minimal/full_test.flac"),
|
||||
(MP4, "../tests/files/assets/minimal/m4a_codec_aac.m4a"),
|
||||
(MP3, "../tests/files/assets/minimal/full_test.mp3"),
|
||||
(MPC, "../tests/files/assets/minimal/mpc_sv8.mpc"),
|
||||
(OPUS, "../tests/files/assets/minimal/full_test.opus"),
|
||||
(RIFF, "../tests/files/assets/minimal/wav_format_pcm.wav"),
|
||||
(SPEEX, "../tests/files/assets/minimal/full_test.spx"),
|
||||
(VORBIS, "../tests/files/assets/minimal/full_test.ogg"),
|
||||
(WAVPACK, "../tests/files/assets/minimal/full_test.wv"),
|
||||
(AAC, "assets/01 TempleOS Hymn Risen (Remix).aac"),
|
||||
(AIFF, "assets/01 TempleOS Hymn Risen (Remix).aiff"),
|
||||
(APE, "assets/01 TempleOS Hymn Risen (Remix).ape"),
|
||||
(FLAC, "assets/01 TempleOS Hymn Risen (Remix).flac"),
|
||||
(MP4, "assets/01 TempleOS Hymn Risen (Remix).m4a"),
|
||||
(MP3, "assets/01 TempleOS Hymn Risen (Remix).mp3"),
|
||||
(MPC, "assets/01 TempleOS Hymn Risen (Remix).mpc"),
|
||||
(OPUS, "assets/01 TempleOS Hymn Risen (Remix).opus"),
|
||||
(RIFF, "assets/01 TempleOS Hymn Risen (Remix).wav"),
|
||||
(SPEEX, "assets/01 TempleOS Hymn Risen (Remix).spx"),
|
||||
(VORBIS, "assets/01 TempleOS Hymn Risen (Remix).ogg"),
|
||||
(WAVPACK, "assets/01 TempleOS Hymn Risen (Remix).wv"),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue