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

Special-case == as with other one-argument functions #374

Open
pdeffebach opened this issue Dec 19, 2023 · 2 comments
Open

Special-case == as with other one-argument functions #374

pdeffebach opened this issue Dec 19, 2023 · 2 comments

Comments

@pdeffebach
Copy link
Collaborator

Similar to :A + :B, we can have :A == 1 become ==(1) I think.

@bkamins
Copy link
Member

bkamins commented Dec 20, 2023

what difference does it make?

@pdeffebach
Copy link
Collaborator Author

pdeffebach commented Dec 22, 2023

It might lower compile time latency for first calling the expression, thats all

julia> @time transform(df, :a => ByRow(==(1)) => :c)
  0.000151 seconds (165 allocations: 9.984 KiB)
3×3 DataFrame
 Row │ a      b      c     
     │ Int64  Int64  Bool  
─────┼─────────────────────
   1 │     1      4   true
   2 │     2      5  false
   3 │     3      6  false

julia> @time transform(df, :a => ByRow(t -> t == 1) => :c)
  0.043623 seconds (45.06 k allocations: 3.008 MiB, 98.64% compilation time)
3×3 DataFrame
 Row │ a      b      c     
     │ Int64  Int64  Bool  
─────┼─────────────────────
   1 │     1      4   true
   2 │     2      5  false
   3 │     3      6  false

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