Closed itteerde closed 11 months ago
One difference that is there already with the fresh 101 is that in dnd5e the block of 100 can be moved without any perceivable lag, too, while in cpr moving that block of 100 Tokens has a clear lag -- though not at all an alarming one in itself (probably below 1s, that should be measureable easy enough with using a Macro to move them [@itteerde Write that Macro!]). The comparison however might be relevant.
so what to call for the movement in a measured context (Macro)?: https://discord.com/channels/170995199584108546/699750150674972743/1148278914230276199
the simple highest level macro
const start = performance.now();
await canvas.tokens.moveMany({ dx: 1, dy: 1 });
console.log(`time measured: ${performance.now() - start}ms`);
first line each: PC selected, second line each: all Mooks/NPCs selected CPR 101 tokens (1 PC, 100 Mooks) at otherwise empty scene DND 101 (1 PC, 100 NPC) tokens at otherwise empty scene the explosion here is only in moving the many, but there is a significant hit to moving just the one PC, too. Next step should be to demonstrate a condition where that moving one explodes, too -- as it did in the game blocking/ session aborting scene.
looking into any kinds of warming up or building up blockage scenarios
CPR, moving the 1 PC repeatedly
DND, moving the 1 PC repeatedly
oh!
pf2e
Measurements of ~0ms are hitting the macro to quickly. Other than that I think the numbers are reliable enough.
full text search indicates that the registering hooks section is complete, and no other registering is hidden anywhere
in cpr.js
registerHooks();
calling hooks.js
export default function registerHooks() {
actorHooks.default();
actorSheetHooks.default();
chatHooks.default();
folderHooks.default();
itemHooks.default();
tokenHudHooks.default();
uiHooks.default();
hotbarHooks.default();
tokenHooks.default();
externalHooks.default();
}
therefore WTF?! indeed. The answer probably being polymorphism.
What is happening here? Is it really destroying the old one and making a new one? And it is doing it for every Token, despite only one requiring to be mutated?
how can it be 1/2 time today? I mean that is still to slow, but it is way faster than ever before.
Not really getting anywhere, next step destructive testing trying to get some idea what at all is making an impact, an in parallel reading the whole Foundry code.
Establish performance indicators, and make them useable, regression testing and testing if improvements are improvements indeeed.