Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline functions frequently called from Materialize #514

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions container/src/columnation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ impl<T: Columnation> TimelyStack<T> {
///
/// Note that the associated region is not initialized to a specific capacity
/// because we can't generally know how much space would be required.
#[inline(always)]
pub fn with_capacity(capacity: usize) -> Self {
Self {
local: Vec::with_capacity(capacity),
Expand Down Expand Up @@ -62,6 +63,7 @@ impl<T: Columnation> TimelyStack<T> {
/// Copies an element in to the region.
///
/// The element can be read by indexing
#[inline]
pub fn copy(&mut self, item: &T) {
// TODO: Some types `T` should just be cloned.
// E.g. types that are `Copy` or vecs of ZSTs.
Expand All @@ -70,6 +72,7 @@ impl<T: Columnation> TimelyStack<T> {
}
}
/// Empties the collection.
#[inline]
pub fn clear(&mut self) {
unsafe {
// Unsafety justified in that setting the length to zero exposes
Expand All @@ -81,6 +84,7 @@ impl<T: Columnation> TimelyStack<T> {
/// Retain elements that pass a predicate, from a specified offset.
///
/// This method may or may not reclaim memory in the inner region.
#[inline]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if this is actually helpful.

pub fn retain_from<P: FnMut(&T) -> bool>(&mut self, index: usize, mut predicate: P) {
let mut write_position = index;
for position in index..self.local.len() {
Expand All @@ -102,6 +106,7 @@ impl<T: Columnation> TimelyStack<T> {
///
/// # Safety
/// Elements within `local` can be reordered, but not mutated, removed and/or dropped.
#[inline(always)]
pub unsafe fn local(&mut self) -> &mut [T] {
&mut self.local[..]
}
Expand Down
1 change: 1 addition & 0 deletions timely/src/progress/frontier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ impl<T> MutableAntichain<T> {
/// This method is meant to be used for bulk updates to the frontier, and does more work than one might do
/// for single updates, but is meant to be an efficient way to process multiple updates together. This is
/// especially true when we want to apply very large numbers of updates.
#[inline]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove.

fn rebuild(&mut self)
where
T: Clone + PartialOrder + Ord,
Expand Down