polars_core::prelude::string_cache

Function enable_string_cache

Source
pub fn enable_string_cache()
Available on crate feature dtype-categorical only.
Expand description

Enable the global string cache.

Categorical columns created under the same global string cache have the same underlying physical value when string values are equal. This allows the columns to be concatenated or used in a join operation, for example.

Note that enabling the global string cache introduces some overhead. The amount of overhead depends on the number of categories in your data. It is advised to enable the global string cache only when strictly necessary.