226
General Discussion / Re: if self.isCoder(): post() #Programming Thread
« on: June 06, 2015, 05:33:01 pm »They're waaaay faster to look up by array index, it's literally a single machine instruction. Associative containers have tons of stuff going on in the background.The fastest when it comes to non-contiguous structures like linked lists, I mean.
Consider this: You have jiggabytes of available memory, but you're already short on runtime (for no evident reason). I think the tradeoff is worth it.Yep, that's probably the best option. It just feels so wrong
PS: I still think you're doing something entirely else wrong. Have you tried counting the number of calls to floodfill(...) per tick?I counted the calls to floodFill(), and it's always the same as the number of regions found. It couldn't be less than that, and there are no redundant calls.
EDIT: goddammit, the frame time is significantly less than 350ms when running the function, I forgot to go back to release build. It's still a slowdown, just not as much as I said. I got some ideas to speed it up anyway, though.



