Skip to content

Efficient broadcast comparison #150

@cstjean

Description

@cstjean

On 0.6,

julia> heys1 = fill("Hey", 10000);

julia> heys3 = CategoricalVector(heys1);

julia> @btime heys1 .== "Hey";
  62.509 μs (21 allocations: 6.19 KiB)

julia> @btime heys3 .== "Hey";
  101.900 μs (21 allocations: 6.19 KiB)

Theoretically the second comparison should be faster, since it should boil down to comparing integers (or, in this case, realizing that no value in the pool is ==). Is there a way of implementing this? I'm not familiar with broadcasting innards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions