OpenDreamProject / OpenDream

A project for running games made in the DM programming language
MIT License
200 stars 109 forks source link

Check that pragmas are enabled before doing expensive checks for emitting them #1881

Open ike709 opened 2 months ago

ike709 commented 2 months ago

Mostly creating this to as a reminder to investigate further at some point. Actual benchmarking has not been done yet.

Right now various pragmas sometimes involve doing relatively expensive and/or absurdly frequent checks to see if they should emit, only for some of them to not even do anything because the warning code is disabled.

Instead, in such cases, we should be doing a relatively quick check that the pragma is enabled (aka any non-disabled warning level) before we bother with doing checks to see if we should emit the warning code.