I want to use JMH to prove the time complexity of adding to/ deleting from a Treeset in a Java orderbook, it should be O(log n) for insertion and deletion.
For insertion it is independent, as N grows it is not reliant on other messages. However for deletion, the orders need to be added in the first instance in order to be deleted. When performing the benchmarking if I was to preload all of the Orders, the Treeset will be full to begin with so it would not be realistic. Do I need to just process all messages in the same order they came, then run without the deletes and compare the times?
Is N the number of deletes or the size of the Treeset?