implemented optimal datastructure for profiling service