07-01-2024, 03:58 AM
When I write large libraries I create a copy of the library with all error checks removed.
I'm not talking about $CHECKING: but actual lines of code that checks for errors:
IF InputValue% > MaxAllowedValue% THEN Report_Error "blah blah blah"
Stuff like that. Once I have a piece of code working 100% that uses a library I then compile with a version of the library with all checks removed for speed. For instance, my sprite library consists of:
Sprite.BI
Sprite.BM
Sprite_Noerror.BM
Sprite_NoError.BM has no checks for valid syntax or values. That kind of stuff adds up and slows things down.
In fact, I'm just about finished with a complete rewrite of that old sprite library with an eye toward speed, efficiency, and easier to use. All those removed checks make a difference.
I'm not talking about $CHECKING: but actual lines of code that checks for errors:
IF InputValue% > MaxAllowedValue% THEN Report_Error "blah blah blah"
Stuff like that. Once I have a piece of code working 100% that uses a library I then compile with a version of the library with all checks removed for speed. For instance, my sprite library consists of:
Sprite.BI
Sprite.BM
Sprite_Noerror.BM
Sprite_NoError.BM has no checks for valid syntax or values. That kind of stuff adds up and slows things down.
In fact, I'm just about finished with a complete rewrite of that old sprite library with an eye toward speed, efficiency, and easier to use. All those removed checks make a difference.