Day 41 of making my own indie MMO without engine or team
Today I finally managed to beat souffle's datalog -> C++ code, it's funny how after a few hours trying, the change that got me over that line was walking back on the assumption that clearing the length of the indices in delta sets would be faster than just starting a new set of indices from scratch every iteration with new allocations. I tried to use a arena allocator to help reuse memory but the bookkeeping I need to add to the data structures made it slower.
This should have been it, the end of the datalog sidequest. But I made a critical miss roll on my sanity check and went ahead to ensure it was also better at facts/ms on my x86_64 desktop (spoiler: it was at 900k but not at 64M)...
I had a general idea of what was happening, but when optimizing you need to measure things, because it's very cheap. So, I spent a few hours trying to get Intel's vtune working on my AMD machine, then resigned and went with AMD uProf. It showed that most of my time is dominated by misspredictions and misses when trying to ensure that the hashtable slot I compute IS the slot of the fact or the index I'm trying to fetch (which happens like ~50% time, due to low load factors).
#woao #solodev #gamedev #indiedev #mmo #devlog #programming #coding
Today I finally managed to beat souffle's datalog -> C++ code, it's funny how after a few hours trying, the change that got me over that line was walking back on the assumption that clearing the length of the indices in delta sets would be faster than just starting a new set of indices from scratch every iteration with new allocations. I tried to use a arena allocator to help reuse memory but the bookkeeping I need to add to the data structures made it slower.
This should have been it, the end of the datalog sidequest. But I made a critical miss roll on my sanity check and went ahead to ensure it was also better at facts/ms on my x86_64 desktop (spoiler: it was at 900k but not at 64M)...
I had a general idea of what was happening, but when optimizing you need to measure things, because it's very cheap. So, I spent a few hours trying to get Intel's vtune working on my AMD machine, then resigned and went with AMD uProf. It showed that most of my time is dominated by misspredictions and misses when trying to ensure that the hashtable slot I compute IS the slot of the fact or the index I'm trying to fetch (which happens like ~50% time, due to low load factors).
#woao #solodev #gamedev #indiedev #mmo #devlog #programming #coding

