Th0rstenf / Rocksniffer-to-Streamer.bot-extension

A set of streamerbot actions interacting with the Rocksmith RSSniffer
MIT License
6 stars 1 forks source link

Use HashSet rather than string[] for songScene, and similar lists #90

Closed kozaka-tv closed 1 year ago

kozaka-tv commented 1 year ago

And then use HashSet.Contains(T) method, to get for example the information like IsSongScene. Would be way more performant than run over the lists all the time.

Th0rstenf commented 1 year ago

A hash set has constant times for everything, but far larger overhead. For any small set and we're rather talking TINY than small, the current solution is much more performant.

Th0rstenf commented 1 year ago

That being said, it could still be changed, but your reason is not really correct. Do you see other advantages?

While I'm usually all for performance, it's really not relevant. If we check execution times of the whole thing, we're still hardly noticeable in load. So if there are other benefits in totally OK with sacrificing performance for other benefits