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
stacks are dangerously seductive, std::array was apparently safer but still quite tricky
even relative recent (i.e. 2010-2018) rules-of-thumb for compilers have been blown out of the water by Spectre bugs et al. Speculative execution is much harder, if statements are costly even if predictable. Sometimes you do have to optimize not just 'write C++'
But you can get far by just writing C++
Using OpenMP makes the code much faster, but not necessarily on other computers, and maybe not much faster than just distributing it over an embarrrassingly large number of cores.
Dirk says I can't write omp threaded code using IntegerVector and friends. He's almost certainly right but (a) I've been doing it for a while and never had problems and (b) when I've done something else wrong the segfault manifested itself within the day at the latest.
Don't (inadvertently) try to solve the Byzantine Generals problem
The text was updated successfully, but these errors were encountered:
Some random lessons working with
Rcpp
std::array
was apparently safer but still quite trickyif
statements are costly even if predictable. Sometimes you do have to optimize not just 'write C++'R -d ldb
isR -d gdb
is incredible for hunting segfaults. Tutorials: https://blog.davisvaughan.com/2019/04/05/debug-r-package-with-cpp/ and http://kevinushey.github.io/blog/2015/04/13/debugging-with-lldb/ made finding bugs funomp
threaded code usingIntegerVector
and friends. He's almost certainly right but (a) I've been doing it for a while and never had problems and (b) when I've done something else wrong the segfault manifested itself within the day at the latest.The text was updated successfully, but these errors were encountered: