Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Draft: Memoize calls #13099

wants to merge 1 commit into from

Conversation

nordlow
Copy link
Contributor

@nordlow nordlow commented Sep 26, 2021

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 and stderr like ccache does.

Token.sizeof is unchanged.

@dlang-bot
Copy link
Contributor

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 verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

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 references

Your 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 locally

If 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;
Copy link
Contributor Author

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?

@@ -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
Copy link
Member

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.

Copy link
Contributor Author

@nordlow nordlow Sep 26, 2021

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. :)

- Tags tokens that are time dependent (calling ctime)
- Token.sizeof is unchanged
@RazvanN7
Copy link
Contributor

RazvanN7 commented Jan 5, 2022

do an experiment nevertheless and be pragmatic and see if I can get something reliable working that cuts down on CI loads at work.

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants