The cache check tool is a quick way to check if your snapper's caching is done correctly and will utilize the RED engine cache. It can be found in the Monitor extension's Snapper Monitoring section:
Click on the Cache check button and click on your desired snapper, the tool will dump info if the caching is fine. It will also dump warnings that RED caching will not work properly and also if you are missing any caching implementation.
Example successfully caching :
Example of RED cache will fail and missing caching :
Reason for RED Cache fail
When RED caching fails, sometimes you might see this error on your console:
RED copy cache : black listed <Affected Snapper>
This will result in RED engine not reusing the graphics and will try to regenerate the graphics, which will cause some problems to performance if the drawing is already large with multiple of the affected snappers.
One of the reasons that cause the RED caching to fail is because of deeply nested Instance3D in a snapper.
Example of deeply nested Instance3D:
The allowed nested depth for Instance3D is 6 defined in copyCache3D.cm. Any more than that it will start to fail and might not be immediate. Code in Instance3D.cm
/** * Return true if 'this' and 'b' are equal for RED copy purposes. * Ignore transform on first level. * Do not descend more than 'depth' levels. */ public bool redCopyEqual(Primitive3D b, int depth, bool first=true, bool exact=false, bool traceFalse=false, EqualEnv env=EqualEnv()) { if (!super(b, depth, first, exact, traceFalse, env)) return false; if (!exact and depth <= 0) { if (traceFalse) ptrace("->recursive limit ".eRed); return false; }
There is a flag called dbg_traceCopyCacheFail that you can turn on and it will dump out information to the emacs console.
There are ways to get past this. One way is to cache the Instance3D before it is too deep in the loop and the depth count will stop at the cache and compare cached3D instead.
Comments
0 comments
Please sign in to leave a comment.