After looking at the execution in a profiler, there were a few things that stuck out as unusual/undesirable.
The magrittr pipe is a little slower than R's builtin pipe operator, which is now available (wasn't we this project started).
droplevels() also seems to take enough time to warrant more careful use.
Instead of using it everywhere, I am now using it only when I want to look at the levels, for instance to iterate over them.
The investigation also revealed that up to 20% of run-time is spent on checking whether the terminal can represent colors, which seems a lot of redundant work, but that's an issue in the rlang package:
https://github.com/r-lib/rlang/issues/1444
As a minor change, this fixes the script for running from the command-line, which was broken after introducing displaying the environment.
@HumphreyHCB please check (to avoid unexpected clashes)
@sophie-kaleba might be interesting for your R scripts.
After looking at the execution in a profiler, there were a few things that stuck out as unusual/undesirable.
The magrittr pipe is a little slower than R's builtin pipe operator, which is now available (wasn't we this project started).
droplevels()
also seems to take enough time to warrant more careful use. Instead of using it everywhere, I am now using it only when I want to look at the levels, for instance to iterate over them.The investigation also revealed that up to 20% of run-time is spent on checking whether the terminal can represent colors, which seems a lot of redundant work, but that's an issue in the rlang package: https://github.com/r-lib/rlang/issues/1444
As a minor change, this fixes the script for running from the command-line, which was broken after introducing displaying the environment.
@HumphreyHCB please check (to avoid unexpected clashes) @sophie-kaleba might be interesting for your R scripts.