-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expr stats #14102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Expr stats #14102
Conversation
d3497b6
to
fb6da3c
Compare
{"total", Expr::nrCreated.load()}, | ||
{"ExprInt", ExprInt::nrCreated.load()}, | ||
{"ExprFloat", ExprFloat::nrCreated.load()}, | ||
{"ExprString", ExprString::nrCreated.load()}, | ||
{"ExprPath", ExprPath::nrCreated.load()}, | ||
{"ExprVar", ExprVar::nrCreated.load()}, | ||
{"ExprInheritFrom", ExprInheritFrom::nrCreated.load()}, | ||
{"ExprSelect", ExprSelect::nrCreated.load()}, | ||
{"ExprOpHasAttr", ExprOpHasAttr::nrCreated.load()}, | ||
{"ExprAttr", ExprAttrs::nrCreated.load()}, | ||
{"ExprList", ExprList::nrCreated.load()}, | ||
{"ExprLambda", ExprLambda::nrCreated.load()}, | ||
{"ExprCall", ExprCall::nrCreated.load()}, | ||
{"ExprLet", ExprLet::nrCreated.load()}, | ||
{"ExprWith", ExprWith::nrCreated.load()}, | ||
{"ExprIf", ExprIf::nrCreated.load()}, | ||
{"ExprAssert", ExprAssert::nrCreated.load()}, | ||
{"ExprOpNot", ExprOpNot::nrCreated.load()}, | ||
{"ExprConcatStrings", ExprConcatStrings::nrCreated.load()}, | ||
{"ExprPos", ExprPos::nrCreated.load()}, | ||
{"ExprOpEq", ExprOpEq::nrCreated.load()}, | ||
{"ExprOpNEq", ExprOpNEq::nrCreated.load()}, | ||
{"ExprOpAnd", ExprOpAnd::nrCreated.load()}, | ||
{"ExprOpOr", ExprOpOr::nrCreated.load()}, | ||
{"ExprOpImpl", ExprOpImpl::nrCreated.load()}, | ||
{"ExprOpConcatLists", ExprOpConcatLists::nrCreated.load()}, | ||
{"ExprOpUpdate", ExprOpUpdate::nrCreated.load()}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like this could really benefit from some macro like NIX_VALUE_STORAGE_FOR_EACH_FIELD
to make listing all the expr types less error-prone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose... although there's only 2 places where this happens and macros are error-prone in their own ways.
fb6da3c
to
364cd1a
Compare
Motivation
It's useful to know which Exprs are getting made, to know where to focus attention, and to sanity-check how much memory we save by different optimizations. It turns out for a NixOS config evaluation, the top-used Exprs are:
Expr
constructor and therefore increment the total.I know ExprInheritFroms also count as ExprVars, but ExprInheritFroms didn't even make it into the top 5 list, so that doesn't explain the discrepancy.
Context
Relevant to my work tracked in #14088
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.