-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
Are asserts intentionally left compiled in? #14461
Copy link
Copy link
Closed
Labels
buildIssues and PRs related to build files or the CI.Issues and PRs related to build files or the CI.c++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.performanceIssues and PRs related to the performance of Node.js.Issues and PRs related to the performance of Node.js.questionIssues that look for answers.Issues that look for answers.
Metadata
Metadata
Assignees
Labels
buildIssues and PRs related to build files or the CI.Issues and PRs related to build files or the CI.c++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.performanceIssues and PRs related to the performance of Node.js.Issues and PRs related to the performance of Node.js.questionIssues that look for answers.Issues that look for answers.
I was investigating perf in node-chakracore, and I noticed that there were a lot of calls to
IsExternal. I was surprised to find that it was essentially due to this line: https://github.com/nodejs/node/blob/master/src/env-inl.h#L275According to https://github.com/nodejs/node/blob/master/src/util.h#L130
ASSERTis enabled unlessNDEBUGis defined and I don't see anywhere in the build that sets that. Is this intentional? There is also aCHECKmacro which doesn't have the same off switch, so it does seem like asserts are intended to be disabled in release builds.