[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JSON/YAML/TOML/etc. parsing performance

From: Paul Eggert
Subject: Re: JSON/YAML/TOML/etc. parsing performance
Date: Sun, 8 Oct 2017 22:54:19 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

Philipp Stephani wrote:
I don't understand why minimizing the number of checks and assertions
should be a worthwhile goal. At the very least, the assertions document the
assumptions that we make about the values, and as such they are valuable
even if they never trigger.

One can take the process too far. To take a deliberately extreme example, 'eassert (INT_MIN < 0)' would clutter the code unnecessarily, and would be discarded by the compiler anyway. Although none of the assertions in question were *that* obvious, some did have that flavor (and indeed, were optimized away by GCC). The patch that I proposed eliminated those, while retaining the ones that conveyed useful and nonobvious information. Admittedly some of the removals were judgment calls; however, the point remains that easserts should not waste the reader's time unnecessarily.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]