This repository was archived by the owner on Jul 8, 2022. It is now read-only.

Description
I have a server which allows for adding and removing dynamic attributes:
CreateDynamicAttributes(500, 100) - create 500x double spectrum with 100 elements
ClearDynamicAttributes - remove all dynamic attributes
Removing 500 attributes takes more than a minute. Attribute creation is relatively fast.
I have had a look into the code. The problem is in MultiAttribute::remove_attribute which does MultiAttribute::check_associated for all attributes. The overall cost of a single remove_attribute call is thus proportional to N^2 string comparisons (N is the number of attributes). With 1000 attributes configured, removing a single attribute takes ~1 second.
Improvement idea: can we use Attribute* instead of string determine associated attribute?
Callgrind profile:

The helper code was generated by Pogo.
The server is located here