Skip to content

Commit 33902fc

Browse files
committed
Add benchmarks into the readme
1 parent 1e22b58 commit 33902fc

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,50 @@ using the following command in a root of your project:
5757
composer require type-lang/mapper
5858
```
5959

60+
## Benchmarks
61+
62+
Results [here](https://github.com/php-type-language/mapper/actions/workflows/bench.yml)
63+
like [this](https://github.com/php-type-language/mapper/actions/runs/11354044353/job/31580400799#step:7:34).
64+
65+
Sample: An object that contains a collection of objects, which contains
66+
another collection of objects.
67+
68+
```typescript
69+
ExampleObject{
70+
name: string,
71+
items: list<ExampleObject>
72+
}
73+
```
74+
75+
Results:
76+
77+
### Denormalization
78+
79+
Denormalization: Transformation from raw payload (array) to concrete object.
80+
81+
| subject | revs | its | mem_peak | mode | rstdev |
82+
|-----------------------------|------|-----|----------|-----------|--------|
83+
| benchJmsWithAttributes | 50 | 20 | 4.466mb | 32.151μs | ±1.70% |
84+
| benchValinorWithPhpStan | 50 | 20 | 3.870mb | 119.750μs | ±1.21% |
85+
| benchSymfonyWithPhpStan | 50 | 20 | 3.870mb | 126.807μs | ±1.94% |
86+
| benchSymfonyWithDocBlock | 50 | 20 | 3.870mb | 123.889μs | ±1.35% |
87+
| benchTypeLangWithDocBlocks | 50 | 20 | 3.870mb | 34.175μs | ±1.61% |
88+
| benchTypeLangWithAttributes | 50 | 20 | 3.870mb | 34.379μs | ±1.77% |
89+
90+
### Normalization
91+
92+
Normalization: Transformation from object to raw payload (array).
93+
94+
| subject | revs | its | mem_peak | mode | rstdev |
95+
|-----------------------------|------|-----|----------|----------|--------|
96+
| benchJmsWithAttributes | 50 | 20 | 3.870mb | 44.614μs | ±1.92% |
97+
| benchValinorWithPhpStan | 50 | 20 | 3.870mb | 38.229μs | ±1.38% |
98+
| benchSymfonyWithPhpStan | 50 | 20 | 3.870mb | 37.050μs | ±1.20% |
99+
| benchSymfonyWithDocBlock | 50 | 20 | 3.870mb | 37.125μs | ±1.50% |
100+
| benchTypeLangWithDocBlocks | 50 | 20 | 3.870mb | 36.473μs | ±1.69% |
101+
| benchTypeLangWithAttributes | 50 | 20 | 3.870mb | 36.735μs | ±1.68% |
102+
103+
60104
## Quick Start
61105

62106
```php

0 commit comments

Comments
 (0)