Skip to content

BCMath: Avoid using the heap for temporary objects by using arena allocations #14170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 8, 2024

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented May 7, 2024

Benchmark: #14132

Bench 1:

Benchmark 1: ./sapi/cli/php 1.php
  Time (mean ± σ):     401.4 ms ±   2.4 ms    [User: 397.9 ms, System: 3.2 ms]
  Range (min … max):   399.2 ms … 407.8 ms    10 runs
 
Benchmark 2: ./sapi/cli/php_old 1.php
  Time (mean ± σ):     450.6 ms ±   8.0 ms    [User: 448.0 ms, System: 2.2 ms]
  Range (min … max):   445.1 ms … 472.8 ms    10 runs

Summary
  ./sapi/cli/php 1.php ran
    1.12 ± 0.02 times faster than ./sapi/cli/php_old 1.php

Bench 2:

Benchmark 1: ./sapi/cli/php 2.php
  Time (mean ± σ):     462.0 ms ±   4.5 ms    [User: 459.8 ms, System: 1.9 ms]
  Range (min … max):   454.2 ms … 467.6 ms    10 runs
 
Benchmark 2: ./sapi/cli/php_old 2.php
  Time (mean ± σ):     521.8 ms ±   8.7 ms    [User: 519.8 ms, System: 1.5 ms]
  Range (min … max):   515.1 ms … 536.5 ms    10 runs
 
Summary
  ./sapi/cli/php 2.php ran
    1.13 ± 0.02 times faster than ./sapi/cli/php_old 2.php

Bench 3:

Benchmark 1: ./sapi/cli/php 3.php
  Time (mean ± σ):     562.3 ms ±   4.9 ms    [User: 560.9 ms, System: 0.6 ms]
  Range (min … max):   557.7 ms … 571.9 ms    10 runs
 
Benchmark 2: ./sapi/cli/php_old 3.php
  Time (mean ± σ):     607.9 ms ±   9.4 ms    [User: 604.8 ms, System: 2.5 ms]
  Range (min … max):   602.9 ms … 634.0 ms    10 runs

Summary
  ./sapi/cli/php 3.php ran
    1.08 ± 0.02 times faster than ./sapi/cli/php_old 3.php

@nielsdos nielsdos merged commit 70b5a4d into php:master May 8, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants