Yes that’s the worst case for CategoricalArray as it’s not supposed to be used with unique values. The cost of GC is due to allocating one CategoricalValue for each unique level. This PR should improve things a lot, but it’s slower in some cases on Julia 1.5 and below (not sure whether it’s really an issue).