craftr-build-4.x
craftr-build-4.x copied to clipboard
Reduce CraftrBuildGraph.json size by merging equal environment mappings
The environ
dictionary is saved for every build action, but often it is the same across many actions (for when using the Cxx MSVC Toolchain). In these cases, we could greatly decrease the size of the JSON file by storing some kind of reference to the environment instead of a new copy for every action. For example
{
"environs": {
"342343432": { ... }
},
"actions": {
"myproject@main:cxx.compileC": {"environ": "&342343432", ...}
}
}
We could use the Python Object ID for the environments if we want to match exacat instances of the environment mapping, but I suppose checking for content equality is more important, for example if at some place a plain copy of the environment is created but not modified.