-
Notifications
You must be signed in to change notification settings - Fork 0
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
add benchmarks #17
Comments
Probably best to compare against pysparse.ll_mat |
Also, memory usage would be important to understand and document |
Very crude for now, just %timeit and %memit, using the example from pysparse docs: Basically, this is now about 2x slower than |
Also see scipy/scipy#6004 |
The memory usage may be a non-trivial disadvantage for std::map |
It could be, yes. Like I was saying over at scipy issue, I wonder what's the deal with the Wikipedia link map: it's being invoked for both sides of the argument. |
On a more serious note, there's no question that a sorted vector of sorted vectors wins if there's an idea of the number of rows/columns. Otherwise it's either reallocation or back to essentially the same memory as |
Vec of vecs has a per-row overhead, whereas |
But you have to reallocate vectors if there's an insertion into a row which was previously empty and there were non-empty rows from both sides of it? |
In scipy/scipy#6004 I pre-allocate all the row vectors, so I pay the per-vector overhead up-front. |
Makes sense --- so you require an a priori estimate of the number of rows? |
I just realised you've been working on this recently, apologies for stepping on your toes! I scanned scipy PRs so as to not duplicate work, but yours was separate :( |
Yes. This can be relaxed with some work. |
Re: toes: No problem whatsoever! Hope you don't feel I'm stepping on yours. |
In your solution with preallocation: you can probably just have a second vector with row indices. The overhead is at most |
Yep, or have a |
#40 (comment) for some numbers on constructing a Possoin 2D matrix from I've no idea why memory benchmarks report all zeros. From |
and actually compare to, say,
dok_matrix
.The text was updated successfully, but these errors were encountered: