Skip to content

Micro optimisations for move_to - #34840

Draft
betatim wants to merge 2 commits into
scikit-learn:mainfrom
betatim:move_to-optimisation
Draft

betatim wants to merge 2 commits into
scikit-learn:mainfrom
betatim:move_to-optimisation

Conversation

@betatim

@betatim betatim commented Aug 28, 2026

Copy link
Copy Markdown
Member

Reference Issues/PRs

#34604

What does this implement/fix? Explain your changes.

This uses caching to speed up functions that are quite fast, don't have a lot of unique values but get called a lot in the context of array API.

The goal is to reduce the overhead in move_to so that it becomes cheaper to move small arrays.

Todo:

  • benchmarking script

AI usage disclosure

I used AI assistance for:

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Research and understanding

Make it cheaper to move small arrays by liberally caching values in
array API functions that are called a lot.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant