Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Add extra inlining to speed up take (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dandandan authored Jul 25, 2021
1 parent eaa9be9 commit b03c906
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/buffer/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ impl<T: NativeType> MutableBuffer<T> {
/// # Safety
/// This method assumes that the iterator's size is correct and is undefined behavior
/// to use it on an iterator that reports an incorrect length.
// This inline has been validated to offer 50% improvement in operations like `take`.
#[inline]
pub unsafe fn extend_from_trusted_len_iter_unchecked<I: Iterator<Item = T>>(
&mut self,
iterator: I,
Expand Down Expand Up @@ -461,6 +463,8 @@ impl<T: NativeType> MutableBuffer<T> {
/// # Safety
/// This method assumes that the iterator's size is correct and is undefined behavior
/// to use it on an iterator that reports an incorrect length.
// This inline has been validated to offer 50% improvement in operations like `take`.
#[inline]
pub unsafe fn try_from_trusted_len_iter_unchecked<
E,
I: Iterator<Item = std::result::Result<T, E>>,
Expand Down
1 change: 0 additions & 1 deletion src/compute/take/generic_binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

use crate::{
array::{Array, GenericBinaryArray, Offset, PrimitiveArray},
bitmap::{Bitmap, MutableBitmap},
Expand Down
1 change: 0 additions & 1 deletion src/compute/take/primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

use crate::{
array::{Array, PrimitiveArray},
bitmap::{Bitmap, MutableBitmap},
Expand Down

0 comments on commit b03c906

Please sign in to comment.