Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vjik/php-immutable-vs-mutable-bench
https://github.com/vjik/php-immutable-vs-mutable-bench
Last synced: about 5 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/vjik/php-immutable-vs-mutable-bench
- Owner: vjik
- License: bsd-3-clause
- Created: 2024-10-29T14:08:28.000Z (21 days ago)
- Default Branch: master
- Last Pushed: 2024-10-29T17:05:26.000Z (20 days ago)
- Last Synced: 2024-10-29T18:31:50.587Z (20 days ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# PHP immutable objects VS mutable objects
Benchmark running:
```shell
composer run bench
# or
vendor/bin/phpbench run --report=aggregate
```## Results
With PHP version 8.3.13, xdebug ❌, opcache ❌:
```
+-----------+------------------+-----+------+-----+-----------+----------+---------+
| benchmark | subject | set | revs | its | mem_peak | mode | rstdev |
+-----------+------------------+-----+------+-----+-----------+----------+---------+
| MainBench | benchMutable1 | | 1 | 50 | 749.064kb | 1.041μs | ±52.82% |
| MainBench | benchImmutable1 | | 1 | 50 | 749.064kb | 2.984μs | ±32.88% |
| MainBench | benchMutable14 | | 1 | 50 | 749.064kb | 2.998μs | ±24.69% |
| MainBench | benchImmutable14 | | 1 | 50 | 749.072kb | 5.002μs | ±12.40% |
| MainBench | benchMutable36 | | 1 | 50 | 749.064kb | 4.986μs | ±19.32% |
| MainBench | benchImmutable36 | | 1 | 50 | 749.072kb | 10.000μs | ±3.77% |
+-----------+------------------+-----+------+-----+-----------+----------+---------+
```## License
The package is free software. It is released under the terms of the BSD License.
Please see [`LICENSE`](./LICENSE.md) for more information.