Skip to content

Performance: Allocating stats is O(n) #1824

@ggreenway

Description

@ggreenway

Allocating a single stat is O(n) where n is the maximum number of stats that the shared memory can hold. So allocating all of the stats takes O(n^2).

For the default value of 16k stats, this took approximately 1 second, which isn't unreasonable to pay when starting up and/or loading a large config.

When the maximum number of stats is 100k, my benchmark took approximately 2 minutes.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions