UncleScientist / aoc2021

1 stars 1 forks source link

Flamegraph of Day 15 #2

Open godwhoa opened 2 years ago

godwhoa commented 2 years ago

Hey! It's me from twitch chat. Here's the CPU profile for day 15. I think using a HashMap for cost might be the issue. 60% of the CPU time is being spent on HashMap::get Here's the flamegraph generated by pprof-rs: https://a.pomf.cat/onznha.svg I wish I knew enough rust to refactor the code, but this is all I can do. Cheers!

UncleScientist commented 2 years ago

Thanks! my browser won't let me look at that site due to a security issue, but I'd be happy to refactor the code to use an array instead of a hashmap

In fact, it shouldn't be using a hashmap at all, that's something that was left over in my brain when implementing a sparsely populated dungeon map instead of a completely filled-in grid.

Next time AoC goes quickly (like today, for day 17), I'll work on this on-stream