Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,842 changes: 4,842 additions & 0 deletions crates/bashkit-bench/results/bench-a9d59d0fdfe3-linux-x86_64-1795316001.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,307 @@
# Bashkit Benchmark Report

## System Information

- **Moniker**: `a9d59d0fdfe3-linux-x86_64`
- **Hostname**: a9d59d0fdfe3
- **OS**: linux
- **Architecture**: x86_64
- **CPUs**: 4
- **Timestamp**: 1795316001
- **Iterations**: 10
- **Warmup**: 2
- **Prewarm cases**: 3

- **bash executable**: `/usr/bin/bash (GNU Bash 5.2.37(1)-release)`

## Summary

Benchmarked 96 cases across 2 runners.

| Runner | Total Time (ms) | Avg/Case (ms) | Errors | Error Rate | Output Match |
|--------|-----------------|---------------|--------|------------|-------------|
| bashkit | 72.02 | 0.750 | 0 | 0.0% | 100.0% |
| bash | 997.87 | 10.394 | 0 | 0.0% | 100.0% |

## Performance Comparison

**Bashkit is 13.9x faster** than bash on average.

## Results by Category

### Arithmetic

| Benchmark | Runner | Mean (ms) | StdDev | Errors | Match |
|-----------|--------|-----------|--------|--------|-------|
| arith_basic | bashkit | 0.106 | ±0.072 | - | ✓ |
| arith_basic | bash | 1.746 | ±0.110 | - | ✓ |
| arith_complex | bashkit | 0.098 | ±0.026 | - | ✓ |
| arith_complex | bash | 1.718 | ±0.130 | - | ✓ |
| arith_variables | bashkit | 0.093 | ±0.008 | - | ✓ |
| arith_variables | bash | 1.905 | ±0.299 | - | ✓ |
| arith_increment | bashkit | 0.095 | ±0.012 | - | ✓ |
| arith_increment | bash | 1.808 | ±0.151 | - | ✓ |
| arith_modulo | bashkit | 0.112 | ±0.007 | - | ✓ |
| arith_modulo | bash | 1.685 | ±0.104 | - | ✓ |
| arith_loop_sum | bashkit | 0.159 | ±0.024 | - | ✓ |
| arith_loop_sum | bash | 1.765 | ±0.097 | - | ✓ |

### Arrays

| Benchmark | Runner | Mean (ms) | StdDev | Errors | Match |
|-----------|--------|-----------|--------|--------|-------|
| arr_create | bashkit | 0.117 | ±0.064 | - | ✓ |
| arr_create | bash | 1.867 | ±0.222 | - | ✓ |
| arr_all | bashkit | 0.127 | ±0.027 | - | ✓ |
| arr_all | bash | 1.706 | ±0.087 | - | ✓ |
| arr_length | bashkit | 0.116 | ±0.035 | - | ✓ |
| arr_length | bash | 1.749 | ±0.132 | - | ✓ |
| arr_iterate | bashkit | 0.122 | ±0.035 | - | ✓ |
| arr_iterate | bash | 1.778 | ±0.292 | - | ✓ |
| arr_slice | bashkit | 0.109 | ±0.033 | - | ✓ |
| arr_slice | bash | 1.694 | ±0.112 | - | ✓ |
| arr_assign_index | bashkit | 0.126 | ±0.072 | - | ✓ |
| arr_assign_index | bash | 1.664 | ±0.066 | - | ✓ |

### Complex

| Benchmark | Runner | Mean (ms) | StdDev | Errors | Match |
|-----------|--------|-----------|--------|--------|-------|
| complex_fibonacci | bashkit | 8.730 | ±0.646 | - | ✓ |
| complex_fibonacci | bash | 132.593 | ±40.973 | - | ✓ |
| complex_fibonacci_iter | bashkit | 0.191 | ±0.040 | - | ✓ |
| complex_fibonacci_iter | bash | 1.973 | ±0.214 | - | ✓ |
| complex_nested_subst | bashkit | 0.164 | ±0.046 | - | ✓ |
| complex_nested_subst | bash | 3.369 | ±0.226 | - | ✓ |
| complex_loop_compute | bashkit | 0.206 | ±0.065 | - | ✓ |
| complex_loop_compute | bash | 1.755 | ±0.105 | - | ✓ |
| complex_string_build | bashkit | 0.108 | ±0.013 | - | ✓ |
| complex_string_build | bash | 2.017 | ±0.503 | - | ✓ |
| complex_json_transform | bashkit | 1.080 | ±0.124 | - | ✓ |
| complex_json_transform | bash | 5.078 | ±0.256 | - | ✓ |
| complex_pipeline_text | bashkit | 0.271 | ±0.062 | - | ✓ |
| complex_pipeline_text | bash | 3.988 | ±0.280 | - | ✓ |

### Control

| Benchmark | Runner | Mean (ms) | StdDev | Errors | Match |
|-----------|--------|-----------|--------|--------|-------|
| ctrl_if_simple | bashkit | 0.109 | ±0.050 | - | ✓ |
| ctrl_if_simple | bash | 1.675 | ±0.139 | - | ✓ |
| ctrl_if_else | bashkit | 0.120 | ±0.043 | - | ✓ |
| ctrl_if_else | bash | 1.639 | ±0.125 | - | ✓ |
| ctrl_for_list | bashkit | 0.120 | ±0.010 | - | ✓ |
| ctrl_for_list | bash | 1.644 | ±0.097 | - | ✓ |
| ctrl_for_range | bashkit | 0.121 | ±0.008 | - | ✓ |
| ctrl_for_range | bash | 1.805 | ±0.135 | - | ✓ |
| ctrl_while | bashkit | 0.402 | ±0.520 | - | ✓ |
| ctrl_while | bash | 1.976 | ±0.313 | - | ✓ |
| ctrl_case | bashkit | 0.145 | ±0.086 | - | ✓ |
| ctrl_case | bash | 1.668 | ±0.187 | - | ✓ |
| ctrl_function | bashkit | 0.100 | ±0.010 | - | ✓ |
| ctrl_function | bash | 2.173 | ±1.450 | - | ✓ |
| ctrl_function_return | bashkit | 0.142 | ±0.031 | - | ✓ |
| ctrl_function_return | bash | 2.287 | ±0.123 | - | ✓ |
| ctrl_nested_loops | bashkit | 0.155 | ±0.034 | - | ✓ |
| ctrl_nested_loops | bash | 1.783 | ±0.166 | - | ✓ |

### Io

| Benchmark | Runner | Mean (ms) | StdDev | Errors | Match |
|-----------|--------|-----------|--------|--------|-------|
| io_redirect_write | bashkit | 0.138 | ±0.008 | - | ✓ |
| io_redirect_write | bash | 4.233 | ±0.508 | - | ✓ |
| io_append | bashkit | 0.173 | ±0.018 | - | ✓ |
| io_append | bash | 4.191 | ±0.210 | - | ✓ |
| io_dev_null | bashkit | 0.100 | ±0.037 | - | ✓ |
| io_dev_null | bash | 1.690 | ±0.096 | - | ✓ |
| io_stderr_redirect | bashkit | 0.118 | ±0.008 | - | ✓ |
| io_stderr_redirect | bash | 1.657 | ±0.081 | - | ✓ |
| io_read_lines | bashkit | 0.157 | ±0.013 | - | ✓ |
| io_read_lines | bash | 1.783 | ±0.145 | - | ✓ |
| io_multiline_heredoc | bashkit | 0.171 | ±0.018 | - | ✓ |
| io_multiline_heredoc | bash | 3.678 | ±0.511 | - | ✓ |

### Large

| Benchmark | Runner | Mean (ms) | StdDev | Errors | Match |
|-----------|--------|-----------|--------|--------|-------|
| large_loop_1000 | bashkit | 4.905 | ±0.519 | - | ✓ |
| large_loop_1000 | bash | 4.942 | ±0.843 | - | ✓ |
| large_string_append_100 | bashkit | 0.473 | ±0.039 | - | ✓ |
| large_string_append_100 | bash | 2.146 | ±0.401 | - | ✓ |
| large_array_fill_200 | bashkit | 2.212 | ±0.477 | - | ✓ |
| large_array_fill_200 | bash | 2.303 | ±0.215 | - | ✓ |
| large_nested_loops | bashkit | 2.193 | ±0.125 | - | ✓ |
| large_nested_loops | bash | 3.121 | ±0.344 | - | ✓ |
| large_fibonacci_12 | bashkit | 22.718 | ±0.964 | - | ✓ |
| large_fibonacci_12 | bash | 330.498 | ±50.480 | - | ✓ |
| large_function_calls_500 | bashkit | 10.593 | ±0.826 | - | ✓ |
| large_function_calls_500 | bash | 274.325 | ±57.682 | - | ✓ |
| large_multiline_script | bashkit | 0.665 | ±0.158 | - | ✓ |
| large_multiline_script | bash | 2.325 | ±0.675 | - | ✓ |
| large_pipeline_chain | bashkit | 1.355 | ±0.128 | - | ✓ |
| large_pipeline_chain | bash | 4.385 | ±0.370 | - | ✓ |
| large_assoc_array | bashkit | 0.133 | ±0.043 | - | ✓ |
| large_assoc_array | bash | 1.748 | ±0.112 | - | ✓ |

### Pipes

| Benchmark | Runner | Mean (ms) | StdDev | Errors | Match |
|-----------|--------|-----------|--------|--------|-------|
| pipe_simple | bashkit | 0.135 | ±0.025 | - | ✓ |
| pipe_simple | bash | 3.363 | ±0.420 | - | ✓ |
| pipe_multi | bashkit | 0.253 | ±0.038 | - | ✓ |
| pipe_multi | bash | 4.047 | ±0.270 | - | ✓ |
| pipe_command_subst | bashkit | 0.101 | ±0.013 | - | ✓ |
| pipe_command_subst | bash | 2.357 | ±0.133 | - | ✓ |
| pipe_heredoc | bashkit | 0.107 | ±0.022 | - | ✓ |
| pipe_heredoc | bash | 3.252 | ±0.403 | - | ✓ |
| pipe_herestring | bashkit | 0.100 | ±0.014 | - | ✓ |
| pipe_herestring | bash | 3.160 | ±0.144 | - | ✓ |
| pipe_discard | bashkit | 0.099 | ±0.009 | - | ✓ |
| pipe_discard | bash | 2.766 | ±0.861 | - | ✓ |

### Startup

| Benchmark | Runner | Mean (ms) | StdDev | Errors | Match |
|-----------|--------|-----------|--------|--------|-------|
| startup_empty | bashkit | 0.101 | ±0.047 | - | ✓ |
| startup_empty | bash | 1.701 | ±0.191 | - | ✓ |
| startup_true | bashkit | 0.077 | ±0.011 | - | ✓ |
| startup_true | bash | 1.819 | ±0.215 | - | ✓ |
| startup_echo | bashkit | 0.082 | ±0.014 | - | ✓ |
| startup_echo | bash | 1.760 | ±0.137 | - | ✓ |
| startup_exit | bashkit | 0.080 | ±0.015 | - | ✓ |
| startup_exit | bash | 1.718 | ±0.150 | - | ✓ |

### Strings

| Benchmark | Runner | Mean (ms) | StdDev | Errors | Match |
|-----------|--------|-----------|--------|--------|-------|
| str_concat | bashkit | 0.106 | ±0.049 | - | ✓ |
| str_concat | bash | 1.743 | ±0.121 | - | ✓ |
| str_printf | bashkit | 0.083 | ±0.007 | - | ✓ |
| str_printf | bash | 1.660 | ±0.118 | - | ✓ |
| str_printf_pad | bashkit | 0.143 | ±0.120 | - | ✓ |
| str_printf_pad | bash | 1.678 | ±0.105 | - | ✓ |
| str_echo_escape | bashkit | 0.081 | ±0.014 | - | ✓ |
| str_echo_escape | bash | 1.630 | ±0.073 | - | ✓ |
| str_prefix_strip | bashkit | 0.094 | ±0.008 | - | ✓ |
| str_prefix_strip | bash | 1.735 | ±0.232 | - | ✓ |
| str_suffix_strip | bashkit | 0.091 | ±0.008 | - | ✓ |
| str_suffix_strip | bash | 1.625 | ±0.084 | - | ✓ |
| str_uppercase | bashkit | 0.086 | ±0.007 | - | ✓ |
| str_uppercase | bash | 1.821 | ±0.349 | - | ✓ |
| str_lowercase | bashkit | 0.086 | ±0.007 | - | ✓ |
| str_lowercase | bash | 1.850 | ±0.198 | - | ✓ |

### Subshell

| Benchmark | Runner | Mean (ms) | StdDev | Errors | Match |
|-----------|--------|-----------|--------|--------|-------|
| subshell_simple | bashkit | 0.104 | ±0.044 | - | ✓ |
| subshell_simple | bash | 2.352 | ±0.791 | - | ✓ |
| subshell_isolation | bashkit | 0.129 | ±0.070 | - | ✓ |
| subshell_isolation | bash | 2.130 | ±0.117 | - | ✓ |
| subshell_nested | bashkit | 0.169 | ±0.109 | - | ✓ |
| subshell_nested | bash | 3.809 | ±0.219 | - | ✓ |
| subshell_pipeline | bashkit | 0.168 | ±0.043 | - | ✓ |
| subshell_pipeline | bash | 3.445 | ±0.368 | - | ✓ |
| subshell_capture_loop | bashkit | 0.204 | ±0.064 | - | ✓ |
| subshell_capture_loop | bash | 4.136 | ±0.158 | - | ✓ |
| subshell_process_subst | bashkit | 0.135 | ±0.014 | - | ✓ |
| subshell_process_subst | bash | 2.701 | ±0.091 | - | ✓ |

### Tools

| Benchmark | Runner | Mean (ms) | StdDev | Errors | Match |
|-----------|--------|-----------|--------|--------|-------|
| tool_grep_simple | bashkit | 0.258 | ±0.099 | - | ✓ |
| tool_grep_simple | bash | 4.741 | ±0.595 | - | ✓ |
| tool_grep_case | bashkit | 0.290 | ±0.117 | - | ✓ |
| tool_grep_case | bash | 8.649 | ±5.557 | - | ✓ |
| tool_grep_count | bashkit | 0.409 | ±0.489 | - | ✓ |
| tool_grep_count | bash | 4.853 | ±2.102 | - | ✓ |
| tool_grep_invert | bashkit | 0.141 | ±0.047 | - | ✓ |
| tool_grep_invert | bash | 4.019 | ±0.491 | - | ✓ |
| tool_grep_regex | bashkit | 0.297 | ±0.223 | - | ✓ |
| tool_grep_regex | bash | 3.663 | ±0.175 | - | ✓ |
| tool_sed_replace | bashkit | 0.129 | ±0.035 | - | ✓ |
| tool_sed_replace | bash | 4.403 | ±0.466 | - | ✓ |
| tool_sed_global | bashkit | 0.110 | ±0.015 | - | ✓ |
| tool_sed_global | bash | 3.841 | ±0.248 | - | ✓ |
| tool_sed_delete | bashkit | 0.110 | ±0.015 | - | ✓ |
| tool_sed_delete | bash | 4.169 | ±0.490 | - | ✓ |
| tool_sed_lines | bashkit | 0.145 | ±0.063 | - | ✓ |
| tool_sed_lines | bash | 3.788 | ±0.223 | - | ✓ |
| tool_sed_backrefs | bashkit | 0.156 | ±0.027 | - | ✓ |
| tool_sed_backrefs | bash | 3.974 | ±0.241 | - | ✓ |
| tool_awk_print | bashkit | 0.132 | ±0.036 | - | ✓ |
| tool_awk_print | bash | 3.454 | ±0.137 | - | ✓ |
| tool_awk_sum | bashkit | 0.129 | ±0.030 | - | ✓ |
| tool_awk_sum | bash | 3.648 | ±0.222 | - | ✓ |
| tool_awk_pattern | bashkit | 0.207 | ±0.091 | - | ✓ |
| tool_awk_pattern | bash | 3.376 | ±0.123 | - | ✓ |
| tool_awk_fieldsep | bashkit | 0.132 | ±0.045 | - | ✓ |
| tool_awk_fieldsep | bash | 3.698 | ±0.420 | - | ✓ |
| tool_awk_nf | bashkit | 0.142 | ±0.079 | - | ✓ |
| tool_awk_nf | bash | 3.533 | ±0.146 | - | ✓ |
| tool_awk_compute | bashkit | 0.130 | ±0.052 | - | ✓ |
| tool_awk_compute | bash | 3.667 | ±0.490 | - | ✓ |
| tool_jq_identity | bashkit | 1.049 | ±0.109 | - | ✓ |
| tool_jq_identity | bash | 5.170 | ±0.651 | - | ✓ |
| tool_jq_field | bashkit | 1.041 | ±0.129 | - | ✓ |
| tool_jq_field | bash | 5.247 | ±0.329 | - | ✓ |
| tool_jq_array | bashkit | 1.246 | ±0.650 | - | ✓ |
| tool_jq_array | bash | 5.185 | ±0.354 | - | ✓ |
| tool_jq_filter | bashkit | 0.978 | ±0.033 | - | ✓ |
| tool_jq_filter | bash | 5.477 | ±0.476 | - | ✓ |
| tool_jq_map | bashkit | 1.451 | ±0.817 | - | ✓ |
| tool_jq_map | bash | 5.464 | ±0.749 | - | ✓ |

### Variables

| Benchmark | Runner | Mean (ms) | StdDev | Errors | Match |
|-----------|--------|-----------|--------|--------|-------|
| var_assign_simple | bashkit | 0.085 | ±0.008 | - | ✓ |
| var_assign_simple | bash | 1.823 | ±0.222 | - | ✓ |
| var_assign_many | bashkit | 0.159 | ±0.083 | - | ✓ |
| var_assign_many | bash | 1.780 | ±0.162 | - | ✓ |
| var_default | bashkit | 0.115 | ±0.076 | - | ✓ |
| var_default | bash | 1.655 | ±0.034 | - | ✓ |
| var_length | bashkit | 0.109 | ±0.050 | - | ✓ |
| var_length | bash | 1.714 | ±0.139 | - | ✓ |
| var_substring | bashkit | 0.114 | ±0.050 | - | ✓ |
| var_substring | bash | 1.783 | ±0.239 | - | ✓ |
| var_replace | bashkit | 0.114 | ±0.058 | - | ✓ |
| var_replace | bash | 1.679 | ±0.055 | - | ✓ |
| var_nested | bashkit | 0.094 | ±0.009 | - | ✓ |
| var_nested | bash | 1.735 | ±0.146 | - | ✓ |
| var_export | bashkit | 0.091 | ±0.009 | - | ✓ |
| var_export | bash | 1.889 | ±0.240 | - | ✓ |

## Runner Descriptions

| Runner | Type | Description |
|--------|------|-------------|
| bashkit | in-process | Rust library call, no fork/exec |
| bashkit-cli | subprocess | bashkit binary, new process per run |
| bashkit-js | persistent child | Node.js + @everruns/bashkit, warm interpreter |
| bashkit-py | persistent child | Python + bashkit package, warm interpreter |
| bash | subprocess | PATH-selected Bash >=4, new process per run |
| gbash | subprocess | gbash binary (Go), new process per run |
| gbash-server | persistent child | gbash JSON-RPC server, warm interpreter |
| just-bash | subprocess | just-bash CLI, new process per run |
| just-bash-inproc | persistent child | Node.js + just-bash library, warm interpreter |

## Assumptions & Notes

- Times measured in nanoseconds, displayed in milliseconds
- Prewarm phase runs first few cases to warm up JIT/compilation
- Per-benchmark warmup iterations excluded from timing
- Output match compares against bash output when available
- Errors include execution failures and exit code mismatches
- In-process: interpreter runs inside the benchmark process
- Subprocess: new process spawned per benchmark run
- Persistent child: long-lived child process, amortizes startup cost
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Criterion Parallel Execution Benchmark

## System Information

- **Moniker**: `a9d59d0fdfe3-linux-x86_64`
- **Hostname**: a9d59d0fdfe3
- **OS**: linux
- **Architecture**: x86_64
- **CPUs**: 5
- **Timestamp**: 1795314525

## Workload Comparison (50 sessions)

| Benchmark | Time |
|-----------|------|
| workload_types/light_sequential | 6.1603 ms |
| workload_types/light_parallel | 2.3878 ms |
| workload_types/medium_sequential | 26.670 ms |
| workload_types/medium_parallel | 8.2585 ms |
| workload_types/heavy_sequential | 68.155 ms |
| workload_types/heavy_parallel | 26.163 ms |

## Parallel Scaling (medium workload)

| Benchmark | Time |
|-----------|------|
| parallel_scaling/medium_seq/10 | 4.7173 ms |
| parallel_scaling/medium_par/10 | 1.8414 ms |
| parallel_scaling/shared_fs/10 | 1.3012 ms |
| parallel_scaling/medium_seq/50 | 23.725 ms |
| parallel_scaling/medium_par/50 | 8.2302 ms |
| parallel_scaling/shared_fs/50 | 7.2815 ms |
| parallel_scaling/medium_seq/100 | 46.450 ms |
| parallel_scaling/medium_par/100 | 17.274 ms |
| parallel_scaling/shared_fs/100 | 11.391 ms |
| parallel_scaling/medium_seq/200 | 115.18 ms |
| parallel_scaling/medium_par/200 | 34.851 ms |
| parallel_scaling/shared_fs/200 | 23.454 ms |
| parallel_scaling/medium_seq/500 | 232.87 ms |
| parallel_scaling/medium_par/500 | 78.240 ms |
| parallel_scaling/shared_fs/500 | 64.056 ms |
| parallel_scaling/medium_seq/1000 | 472.17 ms |
| parallel_scaling/medium_par/1000 | 202.24 ms |
| parallel_scaling/shared_fs/1000 | 164.85 ms |

## Single Operations

| Benchmark | Time |
|-----------|------|
| single_bash_new | 61.917 µs |
| single_echo | 77.953 µs |
| single_file_write_read | 124.68 µs |
| single_grep | 129.28 µs |
| single_awk | 134.93 µs |
| single_sed | 124.53 µs |
| single_light_script | 117.01 µs |
| single_medium_script | 583.28 µs |
| single_heavy_script | 1.4084 ms |

## Speedup Summary

| Workload | Sequential | Parallel | Speedup |
|----------|-----------|----------|---------|
| light | 6.160 ms | 2.388 ms | **2.58x** |
| medium | 26.670 ms | 8.258 ms | **3.23x** |
| heavy | 68.155 ms | 26.163 ms | **2.61x** |

| Sessions | Sequential | Parallel | Shared FS | Par Speedup |
|----------|-----------|----------|-----------|-------------|
| 10 | 4.717 ms | 1.841 ms | 1.301 ms | **2.56x** |
| 50 | 23.725 ms | 8.230 ms | 7.282 ms | **2.88x** |
| 100 | 46.450 ms | 17.274 ms | 11.391 ms | **2.69x** |
| 200 | 115.180 ms | 34.851 ms | 23.454 ms | **3.30x** |
| 500 | 232.870 ms | 78.240 ms | 64.056 ms | **2.98x** |
| 1000 | 472.170 ms | 202.240 ms | 164.850 ms | **2.33x** |
Loading
Loading