Skip to content
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 as_sparse_double() #43

Merged
merged 1 commit into from
May 10, 2024
Merged

add as_sparse_double() #43

merged 1 commit into from
May 10, 2024

Conversation

EmilHvitfeldt
Copy link
Member

@EmilHvitfeldt EmilHvitfeldt commented May 10, 2024

to close #15

I tried writing a C version of this function. It did better for smaller lengths and worse for longer. so IMO not worth the complexity considering that this isn't going to be a much used function

# A tibble: 10 × 14
   expression     n      min   median `itr/sec` mem_alloc `gc/sec` n_itr  n_gc
   <bch:expr> <dbl> <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl> <int> <dbl>
 1 as_sparse1e1   9.96µs  10.87µs    78997.        0B     23.7  9997     3
 2 as_sparse1e1    3.2µs   3.61µs   261443.        0B     52.3  9998     2
 3 as_sparse1e2  10.17µs  11.07µs    86843.      984B     26.1  9997     3
 4 as_sparse1e2   3.69µs    4.1µs   234696.      984B     23.5  9999     1
 5 as_sparse1e3   11.6µs  12.87µs    74080.    7.99KB     22.2  9997     3
 6 as_sparse1e3   7.22µs      8µs   108443.    7.99KB     21.7  9998     2
 7 as_sparse1e4  24.93µs  30.18µs    31959.   78.31KB     76.9  9976    24
 8 as_sparse1e4  42.56µs  46.25µs    21150.   78.31KB     48.9  9089    21
 9 as_sparse1e5 153.26µs 170.27µs     5809.  781.43KB    161.   2089    58
10 as_sparse1e5 390.48µs  409.8µs     2420.  781.43KB     68.1  1030    29
# ℹ 5 more variables: total_time <bch:tm>, result <list>, memory <list>,
#   time <list>, gc <list>

Screenshot 2024-05-09 at 6 32 40 PM

@EmilHvitfeldt EmilHvitfeldt merged commit 3c241eb into main May 10, 2024
11 checks passed
@EmilHvitfeldt EmilHvitfeldt deleted the as_vector-functions branch May 10, 2024 01:43
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.

add way to turn normal vectors into altrep sparse vectors
1 participant