From c2e47d9dcb79a1ecd45abb2eaf235f96d5508484 Mon Sep 17 00:00:00 2001 From: Serial <69764315+Serial-ATA@users.noreply.github.com> Date: Sat, 4 May 2024 17:20:42 -0400 Subject: [PATCH] benches: Update for recent changes --- .github/workflows/bench.yml | 11 +++++++---- benches/create_tag.rs | 20 ++++++++------------ 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 4303d9fd..de7cfb78 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -1,10 +1,13 @@ name: Continuous Benchmarking with Bencher on: push: - paths: - - 'src/**' - - 'benches/**' - - 'ogg_pager/**' + paths-ignore: + - 'LICENSE-*' + - '**/*.md' + - '.gitignore' + - './examples' + - './fuzz' + - 'CHANGELOG.md' branches: - main workflow_dispatch: diff --git a/benches/create_tag.rs b/benches/create_tag.rs index 1e8c4ba8..3726da1a 100644 --- a/benches/create_tag.rs +++ b/benches/create_tag.rs @@ -3,7 +3,7 @@ use lofty::ape::ApeTag; use lofty::config::WriteOptions; use lofty::id3::v1::Id3v1Tag; -use lofty::id3::v2::Id3v2Tag; +use lofty::id3::v2::{FrameId, Id3v2Tag}; use lofty::iff::aiff::AiffTextChunks; use lofty::iff::wav::RiffInfoList; use lofty::mp4::Ilst; @@ -11,6 +11,8 @@ use lofty::ogg::VorbisComments; use lofty::picture::{MimeType, Picture, PictureType}; use lofty::tag::{Accessor, TagExt}; +use std::borrow::Cow; + use iai_callgrind::{library_benchmark, library_benchmark_group, main}; const ENCODER: &str = "Lavf57.56.101"; @@ -76,17 +78,11 @@ bench_tag_write!([ ); tag.insert_picture(picture); - tag.insert( - Frame::new( - "TSSE", - TextInformationFrame { - encoding: TextEncoding::Latin1, - value: String::from(ENCODER), - }, - FrameFlags::default(), - ) - .unwrap(), - ); + tag.insert(Frame::Text(TextInformationFrame::new( + FrameId::Valid(Cow::Borrowed("TSSE")), + TextEncoding::Latin1, + String::from(ENCODER), + ))); }), (id3v1, Id3v1Tag, |tag| {}), (ilst, Ilst, |tag| {