Skip to content
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

Drawbacks of using this library #105

Open
jmpanfil opened this issue Jul 31, 2024 · 1 comment
Open

Drawbacks of using this library #105

jmpanfil opened this issue Jul 31, 2024 · 1 comment

Comments

@jmpanfil
Copy link

I love pipes in R, so this is a very enticing option for me. However, what are the main drawbacks of using this library? I imagine:

  • It's not "pythonic"
  • No type hinting support
  • Is performance affected?

Great work and thank you!

@JulienPalard
Copy link
Owner

* It's not "pythonic"

Clearly not Pythonic...

* No type hinting support

For the moment, but it could be typed, maybe, in the future (see #76 about this topic).

* Is performance affected?

I'd bet performances are not affected: I'm just using Python generators, the only added cost is one or two function calls per | (not per element traveling the pipe! There's no function calls during the work, only during the setup). (calling a function is not that free in Python). So on very small datasets, on the nanosecond level, you could notice the diff (as long as functions calls are taking a time in the same order of magnitude that the computation being done), but on bigger datasets, you should not (computing things will take orders of magnitude more than calling a few functions).

I have never ran benchmarks on it though and we know that trying to guess performance is a trap :D

You forgot to mention a drawback: exposing operator overloading with different semantics than expected could lead to surprises: imagine the situation where someone wants to use the real bitwise-or operator on the result of a Pipe from my library: it won't work as the overload from my library will be called first. OK the probability that someone wanting this is very very low... but yet I consider it a drawback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants