You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Speed up MatrixExpr.sum(axis=...) via quicksum #1133
Is your feature request related to a problem? Please describe.
np.ndarray.sum(axis=...) will use Expr.__add__ in it inner.
And __add__ will return a new Expr instance each time.
If the matrix is a large dataset, so .sum(axis=...) will become much slower. quicksum use __iadd__ to avoid creating instance.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Inspired by np.apply_along_axis.
We can apply quicksum to .sum(axis=...) too via np.apply_along_axis.
Additional context
Add any other context or screenshots about the feature request here.
A simple demo to show this feature.
It sppeds up 5.2x than before in the shape of (200, 200).
Activity
Zeroto521 commentedon Dec 17, 2025
#1070
Joao-Dionisio commentedon Dec 17, 2025
That is a massive speed improvement @Zeroto521 !