Thanks, Bill. Great info.
- Performance does get a lot worse by just starting a server. For giggles, I also tested this in B82 and it was just as bad, if not worse, with this map.
As I would expect; we've made quite a few tweaks to the fog over the last few builds...
- Doesn't seem to be VBL related because once I remove all VBL, the terrible performance doesn't change.
Ah, I should've thought to check that. Thanks.
- As soon I imported the map, I switched to View as Player (moved a token) and performance got so bad that Maptool was virtually unusable:
- If I do the above tests after I completely fill in FOW, it is still pretty bad with 'view as player':
Timer ZoneRenderer.renderZone (60 elements)
2. calcs: 27 ms
45. tokens: 21 ms
47. tokenlist-7: 18 ms
47. tokenlist-1e: 754 ms
51. renderFog: 196 ms
55. renderFog:combined: 160 ms
56. renderFogArea: 33 ms
58. visionOverlayPlayer: 553 ms
Thanks. I noticed that #47 showed up twice and that shouldn't happen. The CodeTimer is supposed to increment the value each time a new data point is created (although only data points of 10ms or more are reported). So two 47's shouldn't happen. I've fixed that bug.
I also found a bug in the reporting of the numbers for tokenlist-1e. I couldn't understand how those numbers could be so large!
It's not good when your code to track performance has bugs in it!
- It doesn't seem to matter if the server is started with Individual FOW = On or Off - same results.
Hm, good info. The GEA (Global Exposed Area) and TEA (Token's Exposed Area) have to be merged now each time a token is selected. I insisted Joe make this change as it's more accurate, but if it's going to be a performance problem we may have to change the way this works. (Joe: whenever a new zone renderer is made current we could
start a new cache. If a token's fog is in the list we use it and bypass the renderFog() work. Keeping the cache current may be a pain though. I'll consider this as I look through the code.)
- Whew, view as player while a server is started - just another set of numbers for your viewing pleasure:
Timer ZoneRenderer.renderZone (59 elements)
2. calcs: 191 ms
45. tokens: 27 ms
46. tokenlist-1e: 8289 ms
50. renderFog: 4072 ms
54. renderFog:combined: 4049 ms
55. renderFogArea: 19 ms
57. visionOverlayPlayer: 4199 ms
I believe the bold line is the problem. Unfortunately, profiling the code doesn't show enough detail to indicate which parts in particular are taking so long. I fear it's the merging of the various fog pieces though. That could be a problem.
I plan to split the renderFog() method into small pieces so that hopefully the profiler can help isolate the issue.
Thanks a bunch for all that work, Bill -- good stuff.