-
Notifications
You must be signed in to change notification settings - Fork 415
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
Memoize dir contents #1979
Memoize dir contents #1979
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
open Stdune | ||
|
||
type is_component_of_a_group_but_not_the_root = { | ||
group_root : Path.t; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One thing that is slightly weird to me is that you're returning a build path here, but every other constructor is return a source path for the root ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm returning the same kind of path as what the caller gave me, which is I think what counts here. (at least that's what's necessary at the call site where we just call the function again with that path)
I'm not sure that's a good idea: I think |
||
stanzas : Stanza.t list Dir_with_dune.t option; | ||
} | ||
|
||
type t = | ||
| Standalone of | ||
(File_tree.Dir.t * Stanza.t list Dir_with_dune.t option) option | ||
|
@@ -11,8 +16,7 @@ type t = | |
* Stanza.t list Dir_with_dune.t | ||
(* Directory with [(include_subdirs x)] where [x] is not [no] *) | ||
|
||
| Is_component_of_a_group_but_not_the_root of | ||
Stanza.t list Dir_with_dune.t option | ||
| Is_component_of_a_group_but_not_the_root of is_component_of_a_group_but_not_the_root | ||
(* Sub-directory of a [Group_root _] *) | ||
|
||
module DB : sig | ||
|
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.
One thing that I dislike about
Memo.lazy_
is that now we don't know if a function is memoized or not. I know memoization should be transparent, but for anonymous functions it's something you always have to think about it. Would it make sense to have a'a Memo.Lazy.t
type perhaps?(This is a bit of a meta comment not to be addressed in this PR)
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.
Yeah, I was weakly thinking that too. I'll make that change in a separate PR.