kkebo / zyphy

Zyphy is (or will be) a fast web browser engine written in Swift.
MIT License
3 stars 1 forks source link

refactor: refine `Str` initializers #75

Closed kkebo closed 1 month ago

kkebo commented 2 months ago

Comparing results between 'main' and 'Current_run'

Host 'Brown-rhinoceros-beetle' with 8 'aarch64' processors with 7 GB memory, running:
#1 SMP PREEMPT_DYNAMIC Fri May 17 17:22:13 UTC 2024

MyBenchmark

lipsum metrics

Time (wall clock): results within specified thresholds, fold down for details.

``` ╒══════════════════════════════════════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╕ │ Time (wall clock) (μs) * │ p0 │ p25 │ p50 │ p75 │ p90 │ p99 │ p100 │ Samples │ ╞══════════════════════════════════════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╡ │ main │ 15 │ 16 │ 16 │ 16 │ 17 │ 17 │ 17 │ 100 │ ├──────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Current_run │ 15 │ 15 │ 15 │ 15 │ 16 │ 16 │ 16 │ 100 │ ├──────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Δ │ 0 │ -1 │ -1 │ -1 │ -1 │ -1 │ -1 │ 0 │ ├──────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Improvement % │ 0 │ 6 │ 6 │ 6 │ 6 │ 6 │ 6 │ 0 │ ╘══════════════════════════════════════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╛ ```

lipsum-zh metrics

Time (wall clock): results within specified thresholds, fold down for details.

``` ╒══════════════════════════════════════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╕ │ Time (wall clock) (ns) * │ p0 │ p25 │ p50 │ p75 │ p90 │ p99 │ p100 │ Samples │ ╞══════════════════════════════════════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╡ │ main │ 2085 │ 2093 │ 2095 │ 2101 │ 2183 │ 2431 │ 2431 │ 100 │ ├──────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Current_run │ 2081 │ 2087 │ 2090 │ 2095 │ 2099 │ 2241 │ 2241 │ 100 │ ├──────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Δ │ -4 │ -6 │ -5 │ -6 │ -84 │ -190 │ -190 │ 0 │ ├──────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Improvement % │ 0 │ 0 │ 0 │ 0 │ 4 │ 8 │ 8 │ 0 │ ╘══════════════════════════════════════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╛ ```

medium-fragment metrics

Time (wall clock): results within specified thresholds, fold down for details.

``` ╒══════════════════════════════════════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╕ │ Time (wall clock) (μs) * │ p0 │ p25 │ p50 │ p75 │ p90 │ p99 │ p100 │ Samples │ ╞══════════════════════════════════════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╡ │ main │ 49 │ 49 │ 49 │ 49 │ 50 │ 52 │ 53 │ 100 │ ├──────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Current_run │ 49 │ 49 │ 49 │ 50 │ 50 │ 53 │ 53 │ 100 │ ├──────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Δ │ 0 │ 0 │ 0 │ 1 │ 0 │ 1 │ 0 │ 0 │ ├──────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Improvement % │ 0 │ 0 │ 0 │ -2 │ 0 │ -2 │ 0 │ 0 │ ╘══════════════════════════════════════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╛ ```

small-fragment metrics

Time (wall clock): results within specified thresholds, fold down for details.

``` ╒══════════════════════════════════════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╕ │ Time (wall clock) (ns) * │ p0 │ p25 │ p50 │ p75 │ p90 │ p99 │ p100 │ Samples │ ╞══════════════════════════════════════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╡ │ main │ 5272 │ 5288 │ 5321 │ 5468 │ 5505 │ 5659 │ 5659 │ 100 │ ├──────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Current_run │ 5285 │ 5296 │ 5300 │ 5313 │ 5333 │ 5427 │ 5431 │ 100 │ ├──────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Δ │ 13 │ 8 │ -21 │ -155 │ -172 │ -232 │ -228 │ 0 │ ├──────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Improvement % │ 0 │ 0 │ 0 │ 3 │ 3 │ 4 │ 4 │ 0 │ ╘══════════════════════════════════════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╛ ```

strong metrics

Time (wall clock): results within specified thresholds, fold down for details.

``` ╒══════════════════════════════════════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╕ │ Time (wall clock) (μs) * │ p0 │ p25 │ p50 │ p75 │ p90 │ p99 │ p100 │ Samples │ ╞══════════════════════════════════════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╡ │ main │ 22 │ 22 │ 22 │ 22 │ 23 │ 24 │ 24 │ 100 │ ├──────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Current_run │ 22 │ 22 │ 22 │ 22 │ 23 │ 24 │ 24 │ 100 │ ├──────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Δ │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ ├──────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Improvement % │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ ╘══════════════════════════════════════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╛ ```

tiny-fragment metrics

Time (wall clock): results within specified thresholds, fold down for details.

``` ╒══════════════════════════════════════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╤═════════╕ │ Time (wall clock) (ns) * │ p0 │ p25 │ p50 │ p75 │ p90 │ p99 │ p100 │ Samples │ ╞══════════════════════════════════════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╪═════════╡ │ main │ 516 │ 520 │ 538 │ 559 │ 1048 │ 1115 │ 1116 │ 100 │ ├──────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Current_run │ 519 │ 523 │ 530 │ 544 │ 561 │ 562 │ 563 │ 100 │ ├──────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Δ │ 3 │ 3 │ -8 │ -15 │ -487 │ -553 │ -553 │ 0 │ ├──────────────────────────────────────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤ │ Improvement % │ -1 │ -1 │ 1 │ 3 │ 46 │ 50 │ 50 │ 0 │ ╘══════════════════════════════════════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╧═════════╛ ```

github-actions[bot] commented 2 months ago

Code Metrics Report

main (697e587) #75 (8e1f3ce) +/-
Coverage 89.2% 89.2% 0.0%
Details ``` diff | | main (697e587) | #75 (8e1f3ce) | +/- | |-----------|----------------|---------------|------| | Coverage | 89.2% | 89.2% | 0.0% | | Files | 9 | 9 | 0 | | Lines | 1609 | 1609 | 0 | | Covered | 1435 | 1435 | 0 | ```

Code coverage of files in pull request scope (33.3% → 33.3%)

Files Coverage +/-
Sources/Tokenizer/Str.swift 33.3% 0.0%

Reported by octocov

github-actions[bot] commented 1 month ago

Code Metrics Report

main (fa8d66f) #75 (10b41dc) +/-
Coverage 89.2% 89.2% 0.0%
Details ``` diff | | main (fa8d66f) | #75 (10b41dc) | +/- | |-----------|----------------|---------------|------| | Coverage | 89.2% | 89.2% | 0.0% | | Files | 9 | 9 | 0 | | Lines | 1615 | 1615 | 0 | | Covered | 1441 | 1441 | 0 | ```

Code coverage of files in pull request scope (33.3% → 33.3%)

Files Coverage +/-
Sources/Tokenizer/Str.swift 33.3% 0.0%

Reported by octocov