()
| 173 | |
| 174 | |
| 175 | def main() -> None: |
| 176 | args = parse_args() |
| 177 | data_path = args.data.resolve() |
| 178 | if not data_path.exists(): |
| 179 | print(f"Data directory not found: {data_path}", file=sys.stderr) |
| 180 | sys.exit(1) |
| 181 | |
| 182 | results: list[ProfileResult] = [] |
| 183 | for profile in args.profiles: |
| 184 | print(f"\n=== Profile: {profile} ===") |
| 185 | print("Cleaning previous build artifacts...") |
| 186 | cargo_clean(profile) |
| 187 | compile_seconds = cargo_build(profile) |
| 188 | run_seconds = run_benchmark(profile, data_path) |
| 189 | size_bytes = binary_size(profile) |
| 190 | results.append(ProfileResult(profile, compile_seconds, run_seconds, size_bytes)) |
| 191 | |
| 192 | print("\nSummary") |
| 193 | header = f"{'Profile':<15}{'Compile':>12}{'Run':>12}{'Size':>12}" |
| 194 | print(header) |
| 195 | print("-" * len(header)) |
| 196 | for result in results: |
| 197 | print( |
| 198 | f"{result.profile:<15}{human_time(result.compile_seconds):>12}" |
| 199 | f"{human_time(result.run_seconds):>12}{human_size(result.binary_bytes):>12}" |
| 200 | ) |
| 201 | |
| 202 | if __name__ == "__main__": |
| 203 | main() |
no test coverage detected
searching dependent graphs…