From 1a321bb443c58e0d94f011f22aac8ae2838d39f5 Mon Sep 17 00:00:00 2001 From: Geoffroy Couprie Date: Mon, 22 Apr 2024 09:04:00 +0200 Subject: [PATCH 1/2] test inlining split_at_position --- src/traits.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/traits.rs b/src/traits.rs index a7fe99a6f..b1980ff06 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -455,6 +455,7 @@ impl<'a> Input for &'a str { } } + #[inline(always)] fn split_at_position1_complete>( &self, predicate: P, From fe813ab507362e2c06b347430c77c32950e829a2 Mon Sep 17 00:00:00 2001 From: Geoffroy Couprie Date: Sun, 5 May 2024 16:59:58 +0200 Subject: [PATCH 2/2] more inlining --- src/traits.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/traits.rs b/src/traits.rs index 2325ca34d..953a747f3 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -240,6 +240,7 @@ impl<'a> Input for &'a [u8] { } } + #[inline(always)] fn split_at_position>(&self, predicate: P) -> IResult where P: Fn(Self::Item) -> bool, @@ -250,6 +251,7 @@ impl<'a> Input for &'a [u8] { } } + #[inline(always)] fn split_at_position1>( &self, predicate: P, @@ -278,6 +280,7 @@ impl<'a> Input for &'a [u8] { } } + #[inline(always)] fn split_at_position1_complete>( &self, predicate: P, @@ -300,6 +303,7 @@ impl<'a> Input for &'a [u8] { } /// mode version of split_at_position + #[inline(always)] fn split_at_position_mode>( &self, predicate: P, @@ -323,6 +327,7 @@ impl<'a> Input for &'a [u8] { } /// mode version of split_at_position + #[inline(always)] fn split_at_position_mode1>( &self, predicate: P, @@ -408,6 +413,7 @@ impl<'a> Input for &'a str { Err(Needed::Unknown) } + #[inline(always)] fn split_at_position>(&self, predicate: P) -> IResult where P: Fn(Self::Item) -> bool, @@ -419,6 +425,7 @@ impl<'a> Input for &'a str { } } + #[inline(always)] fn split_at_position1>( &self, predicate: P, @@ -435,6 +442,7 @@ impl<'a> Input for &'a str { } } + #[inline(always)] fn split_at_position_complete>( &self, predicate: P, @@ -485,6 +493,7 @@ impl<'a> Input for &'a str { } /// mode version of split_at_position + #[inline(always)] fn split_at_position_mode>( &self, predicate: P, @@ -517,6 +526,7 @@ impl<'a> Input for &'a str { } /// mode version of split_at_position + #[inline(always)] fn split_at_position_mode1>( &self, predicate: P,