mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-08 19:44:57 -05:00
docs(benchmarks): explain the module trick used in the measurement script with comments
This commit is contained in:
@@ -260,10 +260,17 @@ def main():
|
||||
result = {"machine": machine, "metrics": {}, "targets": {}}
|
||||
scripts = list(base.glob("*.py"))
|
||||
|
||||
# Create a directory to store temporary scripts
|
||||
# Clear the previous temporary scripts directory
|
||||
shutil.rmtree(".benchmarks/scripts", ignore_errors=True)
|
||||
|
||||
# Copy the base directory to the new temporary scripts directory
|
||||
shutil.copytree(base, ".benchmarks/scripts")
|
||||
|
||||
# Because we copy the entire base directory to the new temporary scripts directory,
|
||||
# the modified scripts will have access to helper modules defined within the base directory
|
||||
# (e.g., we copy `benchmarks/common.py` to `.benchmarks/scripts/common.py` which allows
|
||||
# the modified `.benchmarks/scripts/x_plus_42.py` to access `common` module`)
|
||||
|
||||
# Process each script under the base directory
|
||||
for path in scripts:
|
||||
# Read the script line by line
|
||||
|
||||
Reference in New Issue
Block a user