Skip to content

Commit ee34df6

Browse files
authored
chore: #[inline] fns vortex-scan (#4483)
Annotates small functions in vortex-scan with `#[inline]` that could benefit from cross crate inlining. Signed-off-by: Alexander Droste <[email protected]>
1 parent 473e486 commit ee34df6

File tree

5 files changed

+11
-0
lines changed

5 files changed

+11
-0
lines changed

vortex-scan/src/arrow.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ where
7474
{
7575
type Item = Result<RecordBatch, ArrowError>;
7676

77+
#[inline]
7778
fn next(&mut self) -> Option<Self::Item> {
7879
self.iter.next()
7980
}
@@ -83,6 +84,7 @@ impl<I> RecordBatchReader for RecordBatchIteratorAdapter<I>
8384
where
8485
I: Iterator<Item = Result<RecordBatch, ArrowError>>,
8586
{
87+
#[inline]
8688
fn schema(&self) -> SchemaRef {
8789
self.schema.clone()
8890
}

vortex-scan/src/filter.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,19 @@ impl FilterExpr {
5252
}
5353

5454
/// The conjuncts that make up this filter expression.
55+
#[inline]
5556
pub fn conjuncts(&self) -> &[ExprRef] {
5657
&self.conjuncts
5758
}
5859

5960
/// The dynamic updates for the given conjunct, if any.
61+
#[inline]
6062
pub fn dynamic_updates(&self, conjunct_idx: usize) -> Option<&DynamicExprUpdates> {
6163
self.dynamic_conjuncts[conjunct_idx].as_ref()
6264
}
6365

6466
/// Returns the next preferred conjunct to evaluate.
67+
#[inline]
6568
pub fn next_conjunct(&self, remaining: &BitVec) -> Option<usize> {
6669
let read = self.ordering.read();
6770
// Take the first remaining conjunct in the ordered list.

vortex-scan/src/multi_scan.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ impl<T> Clone for MultiScanIterator<T> {
5757
impl<T: Send + Sync + 'static> Iterator for MultiScanIterator<T> {
5858
type Item = VortexResult<T>;
5959

60+
#[inline]
6061
fn next(&mut self) -> Option<VortexResult<T>> {
6162
loop {
6263
match self.inner.next()? {

vortex-scan/src/row_mask.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,19 @@ pub(crate) struct RowMask {
1616
}
1717

1818
impl RowMask {
19+
#[inline]
1920
pub fn new(row_offset: u64, mask: Mask) -> Self {
2021
Self { row_offset, mask }
2122
}
2223

24+
#[inline]
2325
/// The row range of the [`RowMask`].
2426
pub fn row_range(&self) -> Range<u64> {
2527
self.row_offset..self.row_offset + self.mask.len() as u64
2628
}
2729

2830
/// The mask of the [`RowMask`].
31+
#[inline]
2932
pub fn mask(&self) -> &Mask {
3033
&self.mask
3134
}

vortex-scan/src/work_stealing_iter.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ impl Clone for WorkStealingArrayIterator {
7373
}
7474

7575
impl ArrayIterator for WorkStealingArrayIterator {
76+
#[inline]
7677
fn dtype(&self) -> &DType {
7778
&self.dtype
7879
}
@@ -81,6 +82,7 @@ impl ArrayIterator for WorkStealingArrayIterator {
8182
impl Iterator for WorkStealingArrayIterator {
8283
type Item = VortexResult<ArrayRef>;
8384

85+
#[inline]
8486
fn next(&mut self) -> Option<Self::Item> {
8587
futures::executor::block_on(self.stream.next())
8688
}

0 commit comments

Comments
 (0)