Skip to content

Various performance issues #3

Description

@karl2883

Hi! I have been profiling modded Celeste maps recently. The GetSensitivity function of SensitiveFlags.cs has a measurable performance impact (around 1.3% of Update time in an average map) even when Chronia Helper is not used at all. This seems to be because of Regex use, which is not cheap performance wise. The function gets called multiple times per frame through MapProcessor.OnLevelUpdate -> ChroniaFlagUtils.SetFlag -> SensitiveFlags.GetSensitivity.
Perhaps a decent solution would be caching whether flags are sensitive? A dictionary lookup seems like it would be significantly cheaper than a Regex check. Maybe you can think of other solutions as well.
Lmk if you have any questions! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions