❔ Optimization thoughts on a loop.
Looking for potential ways to speed up this operation. Any thoughts?
The entries of each HashSet will change regularly and this is iterated frequently.
5 Replies
Which bit specifically are you looking to speed up?
The only things that are actually in the code you posted are a loop, a modulo, and an array access. All of those are pretty fast
Have you benchmarked the general code? Are you sure this is a hotspot? This reeks of premature optimisation
I'm just curious if there's something that sounds out as 'could be better'
double checking my work
well,
if i%4==0
theres no point in checking i%2
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.