-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Use cpp11 for rpkg #2974
Use cpp11 for rpkg #2974
Conversation
… that takes an initializer list
Thanks for the benchmark, what was GC level again? |
R uses a generational garbage collector, which divides allocated nodes into generations based on some notion of age. Younger generations are collected more frequently than older ones. From R-ints:
The people behind the benchmarking package bench, which is used here, have decided that it makes most sense to filter out runs where garbage collections occurred, due to this making things a bit less directly comparable. So for the slower/same/faster comparison, only red dots are actually taken into account. Personally, I don't find it obvious that it always is a good idea to do so. After all, if you're comparing an implementation that triggers GC more frequently, you'd want this penalized in some form. We do have the number of GC invocations per run available (together with other things, such as total allocated memory) and if you're interested in seeing this as well, I'm happy to incorporate this information somehow, or share the raw data as well. As a side remark: results are not super stable. I just reran and this time, for both thresholds of 0.1 and 0.15, "slower" cases are only present in the |
Can you please merge with master, should fix the failing test. |
@hannesmuehleisen Thanks!
If this was directed at me, Gh is telling me that I'm not authorized to merge the PR. |
@nbenn no I mean merge with the latest upstream master and commit the merge to this branch |
This supersedes PR #2948 (which I will close in favor of this). In addition to #2948, this
Currently, this generates data (2 int cols, 1 double col, 1 string col & 1 factor col), with {1e3, 1e5, 1e7} rows and the following benchmarks are run
write_df
: data is written usingdbWriteTable()
and removed again withdbRemoveTable()
register_df
: data is registered usingduckdb_register()
and unregistered withduckdb_unregister()
register_arrow
: an arrowInMemoryDataset
is registered usingduckdb_register_arrow()
and unregistered withduckdb_unregister_arrow()
read_from_tbl
: a native table is read usingdbReadTable()
select_from_tbl
: a row subset of a native table is read usingdbGetQuery()
read_from_df
:dbReadTable()
is used to read a registereddata.frame
select_from_df
: a row subset is read from a registereddata.frame
read_from_arw
:dbReadTable()
is used to read a registered arrow tableselect_from_arw
: a row subset is read from a registered arrow tableRow subsetting is done as
SELECT * FROM table WHERE column > 50
andcolumn
is generated as U(0, 100). Benchmarks are repeated 50 times.@hannesmuehleisen I'm happy to add (or remove) benchmarks if there are relevant aspects that are not yet covered. This is intended as a starting point.
I have attached results of such a benchmark, comparing this (
cpp11
) to bothmaster
and v0.3.1 (release
). In the spirit ofduckdb/scripts/regression_test.py
Line 3 in bd14023
red indicates slower and green faster that master +/- 10% (comparing median runtimes). If the threshold is set to 15% as actually seems to be the case in
duckdb/scripts/regression_test.py
Line 179 in bd14023
failures only remain in the
nrows = 1000
setting. We could of course automate some of this in CI for e.g. a 10e6 row setting or so and fail if slower than master + 15%, similarly to what is done inregression_test.py
.