Skip to content

Cache the regexes used in InstrumentationHelper #1693

Closed
@xPaw

Description

@xPaw

See #1689 for discussion. Currently for every invocation of these functions, a new Regex instance is created which is wasteful.

A quick fix that should work would be using static Regex.IsMatch which caches them internally (up to 15 by default, so Regex.CacheSize may need to be tweaked).

Specifically IsValidFilterExpression, IsLocalMethod, IsTypeFilterMatch. The first two methods even have constant regex patterns.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SolvedThe issue is solved and can be closedenhancementGeneral enhancement requeststale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions