<div dir="ltr"><div>This makes a big difference!<br>Amazingly pathfinding seems to be almost 10x faster if you compile with debug=0; the 100 NPC map only takes about 20% CPU time for me in that case, even without gengcc. I'm rather shocked that the difference is that much, since gengcc only adds overhead on each function call and pointer access, but there aren't that many of those.<br><br></div>I found another profiling tool I'd installed on my system, oprofile. This one is very fancy indeed, it can simultaneously profile the whole system. Anyway, it shows that all the runtime is inside fb_TlsGetCtx and libpthread. I didn't realise that the -exx overhead when you call a function (calls to fb_ErrorSetFuncName and fb_ErrorSetFuncName) store the current function name in thread local storage.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 9 June 2017 at 07:34, James Paige <span dir="ltr"><<a href="mailto:Bob@hamsterrepublic.com" target="_blank">Bob@hamsterrepublic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Now the 100 npc map runs *almost* completely smoothly on my computer.<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 8, 2017 at 12:33 PM,  <span dir="ltr"><<a href="mailto:subversion@hamsterrepublic.com" target="_blank">subversion@hamsterrepublic.<wbr>com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">james<br>
2017-06-08 12:33:51 -0700 (Thu, 08 Jun 2017)<br>
195<br>
A* Pathfinding now caches NPC locations in an NPCCollisionCache object<br>
which is used for the whole pathfinding operation, rather that looping over every npc on every pathfinding collision check.<br>
---<br>
U   wip/game.bas<br>
U   wip/<a href="http://game.bi" rel="noreferrer" target="_blank">game.bi</a><br>
U   wip/<a href="http://game_udts.bi" rel="noreferrer" target="_blank">game_udts.bi</a><br>
U   wip/pathfinding.bas<br>
U   wip/<a href="http://pathfinding.bi" rel="noreferrer" target="_blank">pathfinding.bi</a><br>
U   wip/testgame/a-star.hss<br>
U   wip/testgame/a-star.rpg<br>
______________________________<wbr>_________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.o<wbr>rg</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org<wbr>/listinfo.cgi/ohrrpgce-motherh<wbr>amster.org</a><br>
</blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org">ohrrpgce@lists.motherhamster.<wbr>org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.<wbr>org/listinfo.cgi/ohrrpgce-<wbr>motherhamster.org</a><br>
<br></blockquote></div><br></div>