I'm currently testing a hierarchical method of maze-solving to simulate 1-way
doors, and I've made some very small changes which have resulted in a massive
slowdown - probably 1/8 to 1/10 the original speed. :O
All I've done is replace 5 lines where comparisons using = now use a <= or a >.
The first slowdown was noticed by changing a single line from
#if (walkability [a][b] != unwalkable)
to
#if (walkability [a][b] <= Threshold)
Also, there is one extra test block that got added:
#if (walkability [a][b] = exited)
#declare Threshold = 5;
#end
{switches 1-way doors from a walkable path to an obstacle}
Has anyone experienced this sort of thing before?
Are there faster ways to do this sort of thing?
Using a ternary operator to assign a value rather than #if block?
Using a function rather than an inline equation?
I'm probably going to have to run my old function time-comparison scene file to
perform these types of methods 100,000 times and see if there's a massive
slowdown between = and >.
Really any suggestions are welcome. This is now going WAY too slow.
Post a reply to this message
|