https://pantsbuild.org/ logo
#development
Title
# development
h

hundreds-father-404

11/16/2020, 11:23 PM
For the engine’s memoization, does it really matter that a
FrozenDict
is ordered? Right now, our
__eq__
requires the same ordering, but idk if it matters
w

witty-crayon-22786

11/16/2020, 11:24 PM
it doesn’t matter for memoization, but it could for process fingerprints.
h

hundreds-father-404

11/16/2020, 11:24 PM
Okay. How so?
w

witty-crayon-22786

11/16/2020, 11:24 PM
(does ordered here mean “sorted”, or order preserving?)
h

hundreds-father-404

11/16/2020, 11:25 PM
Order preserving. But to get the memoization, it means we often need to sort. I’m wondering if that sorting is a waste of CPU time
w

witty-crayon-22786

11/16/2020, 11:26 PM
process fingerprints would ideally match up across interpreters, machines, and platforms
h

hundreds-father-404

11/16/2020, 11:27 PM
How do we compute the process fingerprint? Or if there’s code for me to better understand that
w

witty-crayon-22786

11/16/2020, 11:27 PM
@hundreds-father-404: it’s the inputs to
Process
almost verbatim (except translated to protobuf).
h

hundreds-father-404

11/16/2020, 11:28 PM
The particular code I’m staring at is
FirstPartyModuleMapping
for dep inference, which is never used in a process. But changing `FrozenDict`’s
__eq__
could have far ranging impacts
w

witty-crayon-22786

11/16/2020, 11:28 PM
memoization only matters for one process
so if within the same process, two codepaths constructing the dict will end up with “the same value” from an eq/hash perspective, then you’re good for memoization