Open pdeffebach opened 8 months ago
what difference does it make?
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
Similar to
:A + :B
, we can have:A == 1
become==(1)
I think.