mirror of
https://github.com/bloeys/nset.git
synced 2025-12-29 06:28:19 +00:00
Better isEqual bench
This commit is contained in:
@ -140,8 +140,9 @@ Map benefits from sizing while NSet isn't affected, but in both cases NSet remai
|
||||
|
||||
Another case where NSet really shines is checking if two sets are equal.
|
||||
Below is a benchmark that checks whether two NSets/maps with 10 Million elements in each are equal (They are equal, which is the worst case).
|
||||
Here NSet finishes in `0.1ms` but Map takes almost a second with `813ms`.
|
||||

|
||||
Here NSet finishes in `0.1ms` but Map takes almost a second with `813ms`. With a few large numbers NSet suffers a bit but then its performance remains or even improves with more elements, while map degrades greatly.
|
||||
|
||||

|
||||
|
||||
Next we have `GetAllElements`, which simply returns an array of all the elements of NSet/Map (note this is dangerous in NSet. See [Memory characteristics](#memory-characteristics)).
|
||||

|
||||
|
||||
Reference in New Issue
Block a user