Slice Benchmark Report

Generated on 2025-05-05 04:54:08

System Information

PropertyValue
OSDarwin
OS Version23.5.0
Architecturearm64
Python Version3.12.2
Date2025-05-05 04:54:08
CPUApple M1

Executive Summary

This benchmark report compares different implementations of the 'slice' utility, with a focus on comparing the C implementations (slice1.c, slice2.c, and slice3.c).

C Implementation Comparison

Scenario Fastest Implementation Avg. Time (s) Throughput (MB/s)
full_file C-slice3 0.006108 3884.64
large_chunk C-slice3 0.004951 4039.91
small_start C-slice3 0.003196 313.11

Benchmark Visualizations

C Implementation Full File

C Implementation Full File

C Implementation Large Chunk

C Implementation Large Chunk

C Implementation Small Start

C Implementation Small Start

Small Slice Performance

Small Slice Performance

Throughput Comparison

Throughput Comparison

Time By File Size

Time By File Size

C Implementation Details

The benchmark compares three C implementations:

Scenario: full_file

File Size (MB) C-slice1 (s)C-slice2 (s)C-slice3 (s)
10.0070740.0045070.004864
50.0092090.0039780.003536
100.0171070.0048340.004066
200.0417240.0065530.005189
500.0658370.0108550.007451
1000.1481080.0184680.011542

Scenario: small_start

File Size (MB) C-slice1 (s)C-slice2 (s)C-slice3 (s)
50.0069800.0032220.003217
100.0047420.0033070.003050
200.0074120.0035020.003278
500.0063650.0033580.003283
1000.0086340.0034510.003153

Scenario: large_chunk

File Size (MB) C-slice1 (s)C-slice2 (s)C-slice3 (s)
500.0397270.0063930.005018
1000.0411640.0061940.004885

Raw Benchmark Data

impl scenario file_size_MB start_offset slice_size iterations avg_time min_time max_time stdev throughput_MBps
C-slice1 full_file 1 0 1048564 5 0.007074 0.003532 0.020089 0.007278 141.361119
C-slice2 full_file 1 0 1048564 5 0.004507 0.003759 0.005731 0.000952 221.874541
C-slice3 full_file 1 0 1048564 5 0.004864 0.003314 0.009182 0.002492 205.589752
Go full_file 1 0 1048564 5 0.005895 0.004075 0.011783 0.003305 169.633343
Python full_file 1 0 1048564 5 0.024427 0.022679 0.029014 0.002755 40.937837
Ruby full_file 1 0 1048564 5 0.049139 0.038352 0.087905 0.021682 20.350202
Shell full_file 1 0 1048564 5 1.135014 1.098187 1.201039 0.042428 0.881036
C-slice1 small_start 5 0 1048576 5 0.006980 0.002978 0.022489 0.008671 143.266476
C-slice2 small_start 5 0 1048576 5 0.003222 0.002937 0.003996 0.000445 310.366232
C-slice3 small_start 5 0 1048576 5 0.003217 0.002829 0.004143 0.000547 310.848617
Go small_start 5 0 1048576 5 0.003780 0.003594 0.004086 0.000214 264.550265
Python small_start 5 0 1048576 5 0.020993 0.020825 0.021089 0.000117 47.634926
Ruby small_start 5 0 1048576 5 0.039839 0.036753 0.050483 0.005966 25.101032
Shell small_start 5 0 1048576 5 1.099666 1.086396 1.109370 0.009182 0.909367
C-slice1 full_file 5 0 5242864 5 0.009209 0.004151 0.029244 0.011199 542.945460
C-slice2 full_file 5 0 5242864 5 0.003978 0.003814 0.004062 0.000099 1256.909186
C-slice3 full_file 5 0 5242864 5 0.003536 0.003377 0.003687 0.000136 1414.022834
Go full_file 5 0 5242864 5 0.004865 0.004754 0.005045 0.000112 1027.746093
Python full_file 5 0 5242864 5 0.021809 0.021639 0.021938 0.000122 229.262449
Ruby full_file 5 0 5242864 5 0.038637 0.037219 0.041942 0.001887 129.409238

Showing 20 rows out of 91 total. See the CSV file for complete data.

Conclusions

Based on the benchmark results, we can draw the following conclusions:

Report generated automatically by slice/bench/generate_report.py