Build types

I appear to be seeing in the 1.2.3 engine I’m using that nassert’s and pstats are enabled in the delivered distro. I understand pstats being there, but the asserts seem like an odd addition to the official builds. I was wondering what the rationale was? In my case, I hit an nassert() in a VFS read that prevented my code from getting a return code from the function.

In a more general sense, is there a notion of a highly-optimized build available that doesn’t include either asserts or pstats support? I ask because the company I’m working for prefers to use the official releases of Panda’s engine for its development rather than compiling on our own.

Thanks.

Since we use asserts for error-checking of Python-provided parameters, you really don’t want to do any Python development on a version of Panda that doesn’t include asserts–the simplest mismatching of parameters would immediately trigger a segment fault.

What was the assert that was triggered in your VFS case? In some sense, you can consider the exception itself to be a form of return code–especially since Python’s exception handling system is so excellent.

In practice, we have found that building a version of Panda that doesn’t include asserts gets you about a 5% performance gain–possibly worth doing for a final release, but not at all worth the headaches for active development.

David

Fair enough. Thanks for the input. The assertion I received was:
Assertion failed: okflag at line 110 of c:\temp\mkpr\panda3d-1.2.3\built\include\virtualFileSystem.I

I tracked this to the read_file() function. I didn’t track it deeply enough to notice that the nassertr would translate into a Panda exception. If that is the case, then I can understand the rationale. Clearly, I need to be a bit more careful with my code. :slight_smile: