Skip to content

Conversation

@alamb
Copy link

@alamb alamb commented Aug 22, 2025

Targets apache#16433 from @adriangb

While reviewing apache#16433 I noticed we could skip extracting topk values as scalars if we aren't going to be updating the value

// Extract scalar values BEFORE acquiring lock to reduce critical section
let thresholds = match self.heap.get_threshold_values(&self.expr)? {
Some(t) => t,
None => return Ok(()),
Copy link
Author

Choose a reason for hiding this comment

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

this was an early return, but I was thinking that extracting the values can be delayed until after we decided if an update is needed

@adriangb adriangb merged commit d4e2312 into pydantic:topk-filters Aug 22, 2025
27 of 28 checks passed
@alamb alamb deleted the alamb/small_opt branch August 22, 2025 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants