How to read this run
No reliable overall winner
Among the more plausible rows, CASTLE and STL are often close, with some operation-specific differences in both directions. This run is best treated as an initial signal, not as evidence that either implementation is universally faster.
- CASTLE leadsThe visible results favor CASTLE for several hash/tree insert and erase cases, string search, array access, and bitset string conversion. These are individual results, not a general guarantee.
- STL leadsThe visible results favor STL for string construction and substring search, and for the queue push/pop case. Other common operations are close in this run.
- Mostly comparableMany measured operations show similar times, especially basic chrono, utility, and vector operations. Several displayed sub-nanosecond values are too close to the measurement floor for a confident ranking.
Measurement warning. Many rows report only one iteration alongside implausibly large elapsed times; the benchmark harness has timing-pause placement issues in affected cases. Some extremely small times are also vulnerable to optimizer elimination and timer resolution. Treat those rows as invalid for ranking. For a defensible comparison, rerun corrected benchmarks with observable results, repeated samples, and the intended target hardware.
Comparison charts
Charts cover the 28 CASTLE/STL pairs with a valid timing in this run. The other 51 pairs are listed in the results table with the reason they were excluded.
Speed ratio per valid pair
Callbacks
Chrono
Containers
Strings
Events
Utility
STL ÷ CASTLE, CPU ns per op. Bar scale 0–2.25x. Vertical line marks 1.00x (parity).
Outcome counts by category
Values are CASTLE faster / parity / STL faster. Bar width is the share of pairs in each category.
Full results table
CPU time per operation from the captured run, in ns. Ratio = STL ÷ CASTLE. "1 iteration" rows have invalid timing (see the measurement warning). "Loop floor" rows are at or below 0.25 ns, where the work is likely optimized away or limited by timer resolution.
| Benchmark | CASTLE CPU (ns) | STL CPU (ns) | STL ÷ CASTLE | Status |
|---|---|---|---|---|
| Algorithms | ||||
| algorithm_find | 2280295 | 2330118 | n/a | Excluded: 1 iteration |
| algorithm_sort | 2355425 | 2386553 | n/a | Excluded: 1 iteration |
| algorithm_transform | 2414625 | 2464859 | n/a | Excluded: 1 iteration |
| algorithm_lower_bound | 2500997 | 2525663 | n/a | Excluded: 1 iteration |
| Callbacks | ||||
| function_free_call | 0.197 | 1.01 | n/a | Excluded: loop floor |
| function_compile_time_call | 0.197 | 0.197 | n/a | Excluded: loop floor |
| function_functor_call | 0.197 | 0.866 | n/a | Excluded: loop floor |
| function_member_call | 0.197 | 0.197 | n/a | Excluded: loop floor |
| inplace_function_call | 0.870 | 0.892 | 1.03x | Parity |
| inplace_function_construct | 1.01 | 1.01 | 1.00x | Parity |
| Chrono | ||||
| duration_add | 0.197 | 0.197 | n/a | Excluded: loop floor |
| duration_cast | 0.197 | 0.197 | n/a | Excluded: loop floor |
| duration_update | 3682662282 | 3682676639 | n/a | Excluded: 1 iteration |
| time_point_add | 0.197 | 0.197 | n/a | Excluded: loop floor |
| time_point_compare | 0.197 | 0.197 | n/a | Excluded: loop floor |
| time_point_difference | 0.197 | 0.197 | n/a | Excluded: loop floor |
| steady_clock_now | 17.0 | 17.8 | 1.05x | CASTLE faster |
| system_clock_now | 17.1 | 17.5 | 1.02x | Parity |
| Containers | ||||
| array_construct | 0.197 | 0.197 | n/a | Excluded: loop floor |
| array_access | 19.1 | 25.1 | 1.31x | CASTLE faster |
| vector_construct | 0.197 | 5.42 | n/a | Excluded: loop floor |
| vector_push_back | 794 | 794 | 1.00x | Parity |
| vector_emplace_back | 795 | 815 | 1.03x | Parity |
| vector_pop_back | 789 | 808 | 1.02x | Parity |
| vector_clear | 719 | 722 | 1.00x | Parity |
| hash_map_insert | 864 | 1085 | 1.26x | CASTLE faster |
| hash_map_find_hit | 2.0788e+10 | 2.0788e+10 | n/a | Excluded: 1 iteration |
| hash_map_find_miss | 2.0788e+10 | 2.0788e+10 | n/a | Excluded: 1 iteration |
| hash_map_erase | 857 | 1080 | 1.26x | CASTLE faster |
| hash_set_insert | 865 | 1141 | 1.32x | CASTLE faster |
| hash_set_contains | 2.7139e+10 | 2.7140e+10 | n/a | Excluded: 1 iteration |
| hash_set_erase | 855 | 1072 | 1.25x | CASTLE faster |
| tree_map_insert | 1306 | 1546 | 1.18x | CASTLE faster |
| tree_map_find | 3.3366e+10 | 3.3366e+10 | n/a | Excluded: 1 iteration |
| tree_map_lower_bound | 3.3366e+10 | 3.3366e+10 | n/a | Excluded: 1 iteration |
| tree_map_erase | 1110 | 1425 | 1.28x | CASTLE faster |
| tree_set_insert | 1283 | 1505 | 1.17x | CASTLE faster |
| tree_set_find | 3.9973e+10 | 3.9973e+10 | n/a | Excluded: 1 iteration |
| tree_set_lower_bound | 3.9973e+10 | 3.9973e+10 | n/a | Excluded: 1 iteration |
| tree_set_erase | 1114 | 1427 | 1.28x | CASTLE faster |
| stack_push_pop | 931 | 935 | 1.00x | Parity |
| stack_top | 6.2858e+10 | 6.2858e+10 | n/a | Excluded: 1 iteration |
| queue_push_pop | 926 | 879 | 0.95x | STL faster |
| queue_front | 6.5763e+10 | 6.5763e+10 | n/a | Excluded: 1 iteration |
| Strings | ||||
| string_construct | 14.7 | 13.8 | 0.94x | STL faster |
| string_append | 723 | 732 | 1.01x | Parity |
| string_compare_equal | 1.63 | 1.63 | 1.00x | Parity |
| string_find | 4.00 | 8.43 | 2.11x | CASTLE faster |
| string_view_construct | 0.198 | 0.198 | n/a | Excluded: loop floor |
| string_view_find | 0.197 | 0.197 | n/a | Excluded: loop floor |
| string_view_find_substring | 3.84 | 3.74 | 0.97x | Parity |
| string_view_compare | 0.197 | 0.197 | n/a | Excluded: loop floor |
| Events | ||||
| event_dispatch | 2667434 | 2770425 | n/a | Excluded: 1 iteration |
| event_register | 712 | 731 | 1.03x | Parity |
| inplace_event_dispatch | 3138153280 | 3138167959 | n/a | Excluded: 1 iteration |
| inplace_event_register | 717 | 720 | 1.00x | Parity |
| signal_emit | 6317832594 | 6317847931 | n/a | Excluded: 1 iteration |
| signal_connect_disconnect | 714 | 731 | 1.02x | Parity |
| Iterator | ||||
| iterator_distance | 2730594 | 2759599 | n/a | Excluded: 1 iteration |
| iterator_advance | 2767484 | 2774666 | n/a | Excluded: 1 iteration |
| iterator_next | 2813789 | 2826884 | n/a | Excluded: 1 iteration |
| Math | ||||
| math_abs | 0.197 | 0.197 | n/a | Excluded: loop floor |
| math_sqrt | 0.197 | 0.197 | n/a | Excluded: loop floor |
| math_clamp | 0.197 | 0.197 | n/a | Excluded: loop floor |
| math_is_power_of_two | 0.197 | 0.197 | n/a | Excluded: loop floor |
| math_fib | 0.197 | 4.24 | n/a | Excluded: loop floor |
| math_mean | 0.197 | 0.197 | n/a | Excluded: loop floor |
| Utility | ||||
| bitset_set_reset | 0.197 | 0.197 | n/a | Excluded: loop floor |
| bitset_count | 0.197 | 0.197 | n/a | Excluded: loop floor |
| bitset_test | 0.196 | 0.197 | n/a | Excluded: loop floor |
| bitset_to_ullong | 0.197 | 0.197 | n/a | Excluded: loop floor |
| bitset_to_string | 50.2 | 63.1 | 1.26x | CASTLE faster |
| pair_construct | 0.197 | 0.198 | n/a | Excluded: loop floor |
| pair_get | 0.197 | 0.197 | n/a | Excluded: loop floor |
| pair_compare | 0.197 | 0.197 | n/a | Excluded: loop floor |
| variant_construct | 0.197 | 0.197 | n/a | Excluded: loop floor |
| variant_emplace | 1.6229e+10 | 1.6229e+10 | n/a | Excluded: 1 iteration |
| variant_get | 0.197 | 0.197 | n/a | Excluded: loop floor |
| variant_visit | 0.197 | 0.197 | n/a | Excluded: loop floor |
Reminder: CASTLE was created not to compete in performance, but rather to fulfill a mandate for absolute deterministic behavior, explicit failure reporting, fixed-capacity storage and zero dynamic allocation.