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
Draft: Memoize calls #13099
base: master
Are you sure you want to change the base?
Draft: Memoize calls #13099
Conversation
Thanks for your pull request and interest in making D better, @nordlow! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#13099" |
{ | ||
if (isTimeDependent) | ||
{ | ||
// TODO: ok to fake purity and set global.params.isTimeDependent = true; |
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.
Member string
is expected to be true
. Is this a show-stopper?
src/dmd/globals.d
Outdated
@@ -116,6 +116,7 @@ extern (C++) struct Param | |||
bool vtemplates; // collect and list statistics on template instantiations | |||
bool vtemplatesListInstances; // collect and list statistics on template instantiations origins. TODO: make this an enum when we want to list other kinds of instances | |||
bool vgc; // identify gc usage | |||
bool vmemoize; // memoize compilation |
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.
not a v flag.
v means verbose and is for informational flags only.
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 see. Thanks. Am gonna use -cmemoize
for now for easier grepping until someone propose the real name. :)
664582b
to
d82513a
Compare
- Tags tokens that are time dependent (calling ctime) - Token.sizeof is unchanged
@nordlow do you have any proof that this actually helps in any way? I think that we need a clear scenario where this is helpful and how this is better than just using makefile target dependencies. At a first glance, I don't think that this brings any benefits. |
Yeah I know this has been discussed before reaching a conclusion by some that this best reside in a layer above dmd. I fail to agree so I'm gonna do an experiment nevertheless and be pragmatic and see if I can get something reliable working that cuts down on CI loads at work.
I'm gonna deal with time-dependent tokens
__DATE__
,__TIME__
,__TIMESTAMP__
first as I'm not sure how much of a show-stopper those will be.The remaining fingerprinting of input file mod times and content a la git should be straightforward.
Caching needs to store and mimic
stdout
andstderr
likeccache
does.Token.sizeof
is unchanged.