r-lib / vctrs

Generic programming with typed R vectors
https://vctrs.r-lib.org
Other
288 stars 66 forks source link

Discussion: Optimizing binary ops where one input is size 1 #580

Open DavisVaughan opened 5 years ago

DavisVaughan commented 5 years ago

I think that eventually it would be useful to optimize the binary functions that currently recycle to a common size to instead only check for a common size and leave size 1 inputs un-recycled.

This issue should serve as a place to collect functions that could potentially benefit from this:

DavisVaughan commented 5 years ago

Slice assignment such as vec_slice(x, is_na) <- 0

hadley commented 4 years ago

I think we should try #49 before going down this path