WinVector / wrapr

Wrap R for Sweet R Code
https://winvector.github.io/wrapr/
Other
136 stars 11 forks source link

Feature Request: Option to enable benchmarking on pipes #16

Open latot opened 12 months ago

latot commented 12 months ago

Hi all!, I really like this lib, I practically replaced magrittr with it.

Now, after some time playing and everything, I think is very important in languages like R be able to know the timing on the lines.

R is not "uniform", has a lot of operations where you change a little how to do something and impact a lot on the performance.

So, I was thinking would be great, a way to get the benchmarks, get the time of every line, would be great so measure performance and know which lines took more time to focus on improve the code.

I was thinking like:

options(wrapr_pipe_benchmark = TRUE)

This is the basis of the idea, there is still some points.

I know in order for a full benchmark, there is one missed point, and is create an operator to replace <- to handle a similar behavior, but, we can also do funny things like f(x) %.>% . and get the same values :3

Thx!

JohnMount commented 12 months ago

Thanks for your kind words.

I understand your ask, you want to profile the pipe stages (not the pipe operator itself). Probably something I can think about, but I don't have a lot of resources I can commit to that in the short term.