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

Fix #406 #430

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Fix #406 #430

wants to merge 3 commits into from

Conversation

pachadotdev
Copy link
Contributor

@pachadotdev pachadotdev commented Jan 1, 2025

I added refactors and test that translate into a push_back that is closer to a 1:1 ratio than 1:4

# A tibble: 14 × 6
   expression                       len      min mem_alloc n_itr  n_gc
   <bch:expr>                     <int> <bch:tm> <bch:byt> <int> <dbl>
 1 assign_cpp11_(n = len, 123L)       1   9.25µs        0B    20     0
 2 assign_rcpp_(n = len, 123L)        1   8.34µs        0B    20     0
 3 assign_cpp11_(n = len, 123L)      10   14.2µs        0B    20     0
 4 assign_rcpp_(n = len, 123L)       10  12.13µs        0B    20     0
 5 assign_cpp11_(n = len, 123L)     100  48.74µs      848B    20     0
 6 assign_rcpp_(n = len, 123L)      100  32.57µs      848B    20     0
 7 assign_cpp11_(n = len, 123L)    1000 413.58µs    7.86KB    20     0
 8 assign_rcpp_(n = len, 123L)     1000 282.65µs    7.86KB    20     0
 9 assign_cpp11_(n = len, 123L)   10000   4.35ms   78.17KB    19     1
10 assign_rcpp_(n = len, 123L)    10000   3.12ms   78.17KB    20     0
11 assign_cpp11_(n = len, 123L)  100000  53.63ms   781.3KB    19     1
12 assign_rcpp_(n = len, 123L)   100000  35.52ms   781.3KB    20     0
13 assign_cpp11_(n = len, 123L) 1000000 590.79ms   21.63MB    12     8
14 assign_rcpp_(n = len, 123L)  1000000 441.09ms    7.63MB    15     5

# A tibble: 3 × 6
  expression                          len      min mem_alloc n_itr  n_gc
  <bch:expr>                        <int> <bch:tm> <bch:byt> <int> <dbl>
1 grow_strings_cpp11_(len, 123L)  1000000    462ms   23.63MB     7    13
2 grow_strings_rcpp_(len, 123L)   1000000    453ms    7.63MB    16     4
3 grow_strings_manual_(len, 123L) 1000000    438ms   23.63MB     8    12

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.

1 participant