Skip to content

Conversation

@fingolfin
Copy link
Member

These functions are part of the MatrixObj AP, but currently they are basically always slower than their list arithmetic counter parts involving the m{}{} syntax, even in situations where those APIs were supposed to be superior.

I believe this can be reversed by providing tuned methods for these functions (at least for the built-in plain and compressed matrices). In order to tackler this systematically, we need robust benchmarks to measure the effect of any changes.

This patch adds a first version of such benchmarks. Of course what we really need are the improvements, but now at least we have a baseline.

These functions are part of the MatrixObj AP, but currently they
are basically always slower than their list arithmetic counter
parts involving the `m{}{}` syntax, even in situations where those
APIs were supposed to be superior.

I believe this can be reversed by providing tuned methods for these
functions (at least for the built-in plain and compressed matrices).
In order to tackler this systematically, we need robust benchmarks
to measure the effect of any changes.
@fingolfin fingolfin added the release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes label Mar 14, 2025
@fingolfin
Copy link
Member Author

Same should be done for ExtractSubVector and CopySubVector and we should add (eager?) methods for those handling classic "plain" vectors efficiently, so that code can use them without reservations.

It might also be useful to consider allowing the mat{list1}{list2} syntax apply to general MatrixObj, and creating new matrices efficiently. This may (???) require some kernel work, but even if that shouldn't be too hard. But it would mean more existing code could stay as it is and still support general MatrixObj matrices.

@fingolfin fingolfin merged commit 23699e1 into master May 8, 2025
37 checks passed
@fingolfin fingolfin deleted the mh/extract-copy-submatrix branch May 8, 2025 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant