Skip to content

Bug Report: Improve memory usage of components not needing regex #13639

@dbussink

Description

@dbussink

Overview of the Issue

The addition of the ICU regular expression in #13391 has led to a small but nonetheless significant memory increase in components that don't need the evalengine in the end. This applies to things like vtorc, vttablet etc.

Those components do end up importing the evalengine through long dependency chains and also more directly through utility functions like ToInt64 / ToUint64 (https://github.com/vitessio/vitess/blob/main/go/vt/vtgate/evalengine/api_types.go#L60-L96).

But when the evalengine is loaded, we also end up loading the regular expression ICU data files. If we move to lazy loading these files on actual usage, we save additional memory.

Reproduction Steps

Screenshot 2023-07-27 at 10 02 51

The slices.Insert allocation shown here is coming mostly from the icuregex package.

Binary Version

HEAD

Operating System and Environment details

All

Log Fragments

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions