Performance Benchmark Results

Generated on 2026-09-20 06:03:28

This report compares the runtime performance, peak memory usage, and file size of equivalent programs implemented in:

  • C
  • Sere
  • Python

Each implementation was executed 250 times.


Summary

MetricResult
Fastest average runtimeSere
Lowest average memory usageSere
Smallest file sizePython
Number of runs250

Relative performance

Using C as a baseline:

  • Sere averaged 0.47x the runtime of C.
  • Python averaged 2.05x the runtime of C.
  • Python averaged 4.37x the runtime of Sere.

A value close to 1.00x means the implementations performed similarly.


Runtime Performance

LanguageAverageFastestSlowestMedianStd DevRelative
C33.861 ms9.262 ms410.613 ms28.940 ms30.032 ms2.13x
Sere15.898 ms10.418 ms186.216 ms14.199 ms15.652 ms1.00x
Python69.549 ms50.549 ms456.355 ms66.180 ms34.993 ms4.37x

Runtime interpretation

Average represents the mean execution time across all benchmark runs.

Fastest is the shortest observed execution time.

Slowest is the longest observed execution time.

Median is the middle execution time and can be more resistant to occasional operating-system scheduling spikes.

Std Dev shows how much timing variation occurred between runs. A lower standard deviation generally indicates more consistent performance.


Memory Usage

LanguageAverageMinimumPeakMedian
C3.89 MB3.43 MB3.98 MB3.97 MB
Sere3.61 MB3.00 MB3.77 MB3.62 MB
Python10.87 MB10.77 MB10.95 MB10.86 MB

Memory measurements represent the process Resident Set Size, or RSS, observed while the program was running.

RSS approximates the amount of physical memory currently mapped into the process.

The benchmark polls memory approximately once every millisecond, so extremely short-lived memory peaks may not always be observed.


File Size

LanguageHuman-readable sizeBytes
C129.13 KB132,228
Sere492.50 KB504,320
Python24.00 B24

For C and Sere, this represents the compiled executable size.

For Python, this represents the source file size rather than the size of the Python interpreter or its runtime environment.

Because of this, Python's value is not directly equivalent to the compiled executable sizes.


Individual Runtime Results

RunCSerePython
143.961 ms17.442 ms84.135 ms
230.669 ms11.905 ms71.720 ms
330.036 ms14.564 ms65.661 ms
428.653 ms10.637 ms61.648 ms
528.582 ms16.261 ms58.705 ms
630.278 ms19.923 ms60.321 ms
730.860 ms11.671 ms63.211 ms
830.398 ms15.250 ms62.790 ms
928.108 ms12.258 ms59.647 ms
1027.093 ms14.718 ms65.205 ms
1129.023 ms13.806 ms70.440 ms
1233.919 ms12.708 ms60.444 ms
1329.344 ms13.735 ms58.429 ms
1426.337 ms14.011 ms93.099 ms
1527.756 ms17.792 ms52.115 ms
1626.191 ms14.994 ms56.271 ms
1728.176 ms12.528 ms56.158 ms
1827.413 ms16.392 ms57.420 ms
1932.388 ms13.082 ms53.947 ms
2031.537 ms16.568 ms52.937 ms
2150.968 ms15.888 ms54.970 ms
2228.092 ms14.664 ms58.441 ms
2326.883 ms14.893 ms53.822 ms
2426.065 ms13.420 ms54.574 ms
2528.863 ms15.045 ms53.153 ms
2630.909 ms15.253 ms54.153 ms
2728.016 ms13.954 ms52.626 ms
2831.401 ms16.739 ms53.732 ms
2929.557 ms14.320 ms55.799 ms
3028.514 ms14.339 ms54.923 ms
3129.663 ms16.121 ms56.758 ms
3231.385 ms16.766 ms54.823 ms
3328.690 ms15.453 ms51.189 ms
3426.053 ms15.801 ms52.444 ms
3529.221 ms18.424 ms59.350 ms
3629.018 ms15.529 ms57.668 ms
3735.826 ms19.606 ms55.133 ms
3828.325 ms17.508 ms51.305 ms
3936.533 ms15.692 ms57.745 ms
4031.190 ms16.930 ms56.648 ms
4131.547 ms24.690 ms55.190 ms
4228.475 ms21.097 ms51.947 ms
4333.180 ms16.166 ms53.042 ms
4431.541 ms14.029 ms56.828 ms
4531.543 ms16.405 ms62.734 ms
4630.465 ms14.933 ms53.683 ms
4728.611 ms12.913 ms56.559 ms
4831.296 ms16.256 ms51.385 ms
4935.872 ms12.426 ms53.494 ms
5045.760 ms17.834 ms56.131 ms
5147.663 ms17.391 ms57.134 ms
5258.739 ms12.927 ms55.698 ms
5346.889 ms19.416 ms54.529 ms
5447.859 ms16.373 ms52.123 ms
5547.989 ms14.332 ms57.294 ms
5647.721 ms16.793 ms53.525 ms
5751.097 ms16.383 ms55.399 ms
5854.509 ms14.801 ms52.478 ms
5948.205 ms16.462 ms54.847 ms
6057.487 ms14.204 ms59.538 ms
6150.459 ms14.398 ms52.192 ms
6248.606 ms16.866 ms52.068 ms
6353.315 ms14.423 ms57.965 ms
6458.706 ms18.681 ms52.078 ms
6550.770 ms14.276 ms55.240 ms
6663.463 ms12.937 ms56.831 ms
6750.710 ms14.850 ms54.184 ms
6844.270 ms15.004 ms55.031 ms
6942.694 ms12.759 ms59.675 ms
7055.297 ms13.120 ms53.691 ms
7146.774 ms12.467 ms55.597 ms
7245.191 ms15.043 ms50.549 ms
7344.335 ms12.103 ms53.959 ms
7450.916 ms14.832 ms60.494 ms
7554.238 ms11.769 ms61.222 ms
7651.211 ms15.505 ms53.931 ms
7750.876 ms15.718 ms59.431 ms
7865.316 ms13.023 ms59.250 ms
7950.716 ms15.721 ms55.731 ms
8051.153 ms12.981 ms63.729 ms
8142.266 ms14.407 ms61.151 ms
8248.822 ms15.492 ms66.132 ms
8347.714 ms14.239 ms62.388 ms
8492.497 ms16.527 ms68.906 ms
8544.977 ms15.424 ms67.711 ms
8642.885 ms14.238 ms64.287 ms
8760.340 ms17.475 ms60.775 ms
8847.956 ms16.451 ms62.700 ms
8945.617 ms15.717 ms56.028 ms
9051.132 ms17.525 ms65.081 ms
9149.256 ms16.073 ms61.747 ms
9269.432 ms14.624 ms70.625 ms
9340.695 ms15.985 ms62.489 ms
9449.531 ms13.437 ms62.961 ms
9542.015 ms15.061 ms67.377 ms
9649.639 ms14.090 ms59.209 ms
9741.663 ms12.375 ms70.206 ms
9852.140 ms13.106 ms63.376 ms
9947.037 ms14.351 ms59.809 ms
10044.795 ms15.428 ms73.953 ms
10155.396 ms11.464 ms108.557 ms
10261.845 ms14.591 ms100.008 ms
10348.298 ms11.842 ms84.227 ms
10443.782 ms14.184 ms78.098 ms
10551.484 ms13.976 ms84.524 ms
10640.722 ms13.054 ms76.576 ms
10755.074 ms16.402 ms79.125 ms
10846.717 ms12.349 ms79.236 ms
10951.143 ms13.527 ms79.117 ms
11044.181 ms12.711 ms65.823 ms
11161.743 ms16.768 ms71.523 ms
11244.783 ms14.421 ms66.891 ms
11343.672 ms12.996 ms74.519 ms
11444.871 ms15.336 ms68.468 ms
11547.010 ms11.369 ms63.531 ms
11642.740 ms15.160 ms68.224 ms
11753.241 ms11.857 ms64.537 ms
11844.505 ms14.085 ms68.356 ms
11945.756 ms15.042 ms64.948 ms
120106.241 ms12.270 ms76.606 ms
12149.651 ms15.256 ms73.138 ms
12249.793 ms10.418 ms70.688 ms
12355.014 ms13.738 ms64.490 ms
12454.508 ms11.296 ms71.332 ms
12546.241 ms12.452 ms63.155 ms
12651.315 ms13.148 ms64.655 ms
12743.282 ms14.230 ms66.904 ms
12841.981 ms15.604 ms63.757 ms
12946.789 ms12.719 ms65.668 ms
13090.362 ms11.810 ms70.074 ms
13144.909 ms12.226 ms71.697 ms
13246.708 ms12.268 ms69.197 ms
13343.976 ms11.670 ms67.194 ms
13453.312 ms12.490 ms72.648 ms
13541.532 ms12.329 ms71.580 ms
13654.250 ms14.164 ms67.759 ms
13747.190 ms12.005 ms63.551 ms
13845.665 ms13.783 ms72.576 ms
13974.237 ms13.913 ms66.090 ms
14074.023 ms14.019 ms64.698 ms
14154.847 ms14.821 ms68.763 ms
14272.380 ms13.204 ms70.167 ms
14355.667 ms14.327 ms65.313 ms
14425.070 ms25.025 ms63.035 ms
14520.403 ms16.220 ms72.557 ms
14621.519 ms16.610 ms66.228 ms
14718.861 ms18.685 ms70.971 ms
14818.316 ms13.360 ms62.296 ms
14921.790 ms19.577 ms67.007 ms
15019.708 ms16.552 ms75.067 ms
15119.119 ms13.311 ms67.700 ms
15219.346 ms14.035 ms65.902 ms
153410.613 ms12.991 ms423.194 ms
15421.215 ms11.716 ms138.165 ms
15514.795 ms10.946 ms74.980 ms
15685.902 ms13.637 ms73.299 ms
15713.977 ms12.552 ms68.563 ms
15815.080 ms13.143 ms70.876 ms
15914.476 ms14.139 ms69.478 ms
16013.280 ms12.092 ms68.664 ms
16114.229 ms13.781 ms66.914 ms
16213.508 ms12.380 ms71.891 ms
16316.792 ms15.969 ms63.587 ms
16416.552 ms12.813 ms72.992 ms
16515.233 ms14.259 ms66.030 ms
16617.711 ms13.511 ms65.686 ms
16718.210 ms12.271 ms70.440 ms
16813.770 ms13.741 ms60.835 ms
16918.884 ms186.216 ms60.585 ms
17018.800 ms183.408 ms68.500 ms
17114.395 ms14.143 ms62.884 ms
17215.035 ms62.409 ms83.536 ms
17320.903 ms18.159 ms72.012 ms
17416.026 ms14.013 ms67.107 ms
17520.812 ms12.367 ms69.060 ms
17615.365 ms10.668 ms68.184 ms
17715.204 ms11.027 ms66.537 ms
17814.701 ms15.317 ms66.847 ms
17913.395 ms12.485 ms69.805 ms
18016.849 ms13.014 ms62.385 ms
18115.151 ms13.405 ms63.450 ms
18215.153 ms11.638 ms72.395 ms
18314.204 ms14.044 ms68.366 ms
18413.182 ms11.123 ms71.148 ms
18516.134 ms16.012 ms83.773 ms
18613.816 ms13.208 ms106.332 ms
18718.360 ms15.430 ms82.683 ms
18818.655 ms14.827 ms86.612 ms
18914.841 ms11.669 ms76.500 ms
19015.793 ms12.707 ms73.513 ms
19117.789 ms11.898 ms75.443 ms
19214.548 ms13.530 ms74.822 ms
19317.610 ms11.786 ms78.958 ms
19419.829 ms13.869 ms68.735 ms
19516.847 ms11.928 ms75.420 ms
19616.176 ms15.175 ms89.881 ms
19718.369 ms11.137 ms75.220 ms
19817.775 ms15.771 ms79.394 ms
19915.969 ms11.791 ms77.543 ms
20015.722 ms14.544 ms89.607 ms
20118.330 ms15.189 ms77.078 ms
20214.909 ms12.348 ms78.480 ms
20316.060 ms14.864 ms70.793 ms
20421.023 ms12.324 ms80.727 ms
20516.044 ms14.858 ms73.111 ms
20612.879 ms12.250 ms74.868 ms
20722.387 ms16.642 ms72.959 ms
20819.173 ms15.016 ms73.951 ms
20917.039 ms11.815 ms71.863 ms
21014.207 ms13.625 ms76.311 ms
21116.957 ms13.394 ms75.924 ms
21214.739 ms14.865 ms73.731 ms
21314.584 ms13.029 ms456.355 ms
21413.914 ms13.702 ms89.913 ms
21514.431 ms12.012 ms78.089 ms
21613.163 ms13.178 ms77.200 ms
21712.238 ms13.528 ms73.569 ms
21812.153 ms10.665 ms69.053 ms
21910.174 ms14.784 ms66.062 ms
22010.170 ms13.447 ms68.659 ms
22111.737 ms13.822 ms72.745 ms
22210.823 ms11.975 ms65.552 ms
2239.757 ms14.194 ms67.258 ms
2249.782 ms12.884 ms69.698 ms
2259.584 ms13.484 ms76.378 ms
22610.196 ms11.220 ms65.060 ms
22711.020 ms14.476 ms63.506 ms
22811.766 ms14.295 ms63.988 ms
22912.462 ms11.881 ms66.606 ms
2309.762 ms15.071 ms64.997 ms
23111.041 ms12.378 ms71.209 ms
23211.148 ms17.092 ms68.256 ms
23311.445 ms11.532 ms62.653 ms
23414.263 ms14.976 ms67.254 ms
23512.617 ms14.380 ms64.193 ms
23611.566 ms12.366 ms67.182 ms
23712.198 ms13.267 ms68.206 ms
23813.002 ms12.406 ms61.602 ms
23912.684 ms15.590 ms71.917 ms
24010.145 ms11.883 ms67.105 ms
24110.203 ms16.406 ms66.334 ms
2429.262 ms19.761 ms68.108 ms
24315.923 ms13.480 ms65.185 ms
24426.772 ms17.417 ms67.584 ms
24513.297 ms15.743 ms66.545 ms
24615.887 ms14.276 ms73.265 ms
24713.889 ms15.450 ms65.470 ms
24813.697 ms15.761 ms67.196 ms
24913.930 ms12.474 ms68.257 ms
25012.530 ms14.733 ms66.829 ms

These are the raw runtime measurements for every benchmark iteration.

They are useful for identifying outliers, scheduler interference, startup noise, or unusually inconsistent runs.


Benchmark Methodology

Each program is launched as a new operating-system process using Python's subprocess.Popen.

Execution time is measured using time.perf_counter().

The timer begins immediately before process creation and ends after the process has terminated and its output has been collected.

Memory consumption is monitored with psutil using process.memory_info().rss.

The process is sampled approximately every 1 millisecond.


Important Benchmarking Context

These results measure more than just the execution speed of the program itself.

Because a new process is started for every benchmark run, the measured time also includes some operating-system overhead such as:

  • process creation
  • executable loading
  • dynamic library loading
  • runtime initialization
  • Python interpreter startup
  • process teardown
  • stdout and stderr pipe handling

For programs that execute extremely quickly, these costs can represent a significant percentage of total measured runtime.

This is especially important when comparing compiled languages such as C and Sere.

If the actual benchmark workload only takes a fraction of a millisecond, Windows process startup may dominate the result.


Python Comparison Caveat

Python has a larger startup cost because each benchmark run launches a complete Python interpreter.

This benchmark therefore measures:

Python interpreter startup + script execution

rather than only the execution time of the Python benchmark workload itself.

This is still useful when evaluating short command-line programs, but it should not be interpreted as a pure comparison of language execution speed.

For CPU-bound language benchmarks, a better test is usually to perform the benchmark workload many thousands or millions of times inside each process.


Memory Measurement Caveat

Peak memory is obtained through polling.

Because memory is sampled every millisecond, a memory allocation that exists for less than one polling interval may not be recorded.

The reported peak should therefore be considered an observed peak rather than a guaranteed absolute maximum.


Interpreting Sere vs C

C provides a useful baseline because it compiles directly to native machine code with minimal runtime overhead.

Sere is also compiled, so comparing it to C can help reveal overhead introduced by areas such as:

  • generated LLVM IR
  • runtime initialization
  • garbage collection
  • bounds checks
  • abstraction layers
  • standard library initialization
  • allocator behavior
  • code generation quality

A Sere result close to C suggests that the generated native code and runtime overhead are relatively small for this workload.

Larger differences should be investigated using larger workloads before drawing conclusions, because startup overhead can heavily distort very short benchmarks.


Recommendations for More Reliable Results

For more serious compiler benchmarking, consider:

  1. Increasing the number of runs.
  2. Running benchmark workloads many times inside each executable.
  3. Performing several warm-up runs before collecting measurements.
  4. Testing multiple workloads instead of a single program.
  5. Measuring CPU-heavy, allocation-heavy, and I/O-heavy programs separately.
  6. Building C and Sere with equivalent optimization levels.
  7. Closing unnecessary background applications.
  8. Running benchmarks while the system is idle.
  9. Comparing generated assembly or LLVM IR for suspicious performance differences.
  10. Reporting median and variance alongside average runtime.

For example:

python perf.py 100

will usually provide a more stable average than a small number of runs.


Benchmark Environment

This report was generated automatically by perf.py.

Python executable:

C:\Python314\python.exe

Platform:

win32

Benchmark files:

C:      C:\Users\jackw\OneDrive\Desktop\git-projects\sere\test-c.exe
Sere:   C:\Users\jackw\OneDrive\Desktop\git-projects\sere\test.exe
Python: C:\Users\jackw\OneDrive\Desktop\git-projects\sere\test.py

Generated automatically by the Sere benchmark script.