Skip to content

Commit 5b7d913

Browse files
Fix predicate and rerun benchmark
1 parent a1a2d45 commit 5b7d913

File tree

6 files changed

+337
-275
lines changed

6 files changed

+337
-275
lines changed

crates/bpe/images/performance-appending.svg

Lines changed: 56 additions & 44 deletions
Loading

crates/bpe/images/performance-comparison.svg

Lines changed: 67 additions & 49 deletions
Loading

crates/bpe/images/performance-counting.svg

Lines changed: 56 additions & 40 deletions
Loading

crates/bpe/images/performance-encoding.svg

Lines changed: 76 additions & 64 deletions
Loading

crates/bpe/images/performance-worstcase.svg

Lines changed: 81 additions & 75 deletions
Loading

crates/bpe/src/byte_pair_encoding.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,9 +601,7 @@ pub fn create_test_string_with_predicate(
601601
.map_or(0, |(offset, _)| bytes.len() - (offset + 1));
602602
assert!(last >= valid_bytes);
603603
if std::str::from_utf8(&bytes[valid_bytes..last]).is_ok()
604-
&& predicate(
605-
std::str::from_utf8(&bytes[valid_bytes..last]).expect("should be valid"),
606-
)
604+
&& predicate(std::str::from_utf8(&bytes[0..last]).expect("should be valid"))
607605
{
608606
tokens.push(i);
609607
valid_bytes = last;

0 commit comments

Comments
 (0)