Skip to content

Commit

Permalink
[doc] benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
jkassemi committed Jan 9, 2025
1 parent 3ad9cdf commit 9ccbf8e
Showing 1 changed file with 13 additions and 69 deletions.
82 changes: 13 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,75 +11,19 @@ MongoMallard is a fast ORM-like layer on top of PyMongo, based on MongoEngine.
Benchmarks
----------

Sample run on a 2.7 GHz Intel Core i5 running OS X 10.8.3
Sample run on a Apple M3 Max running Sonoma 14.6.1

<table>
<tr>
<th></th>
<th>MongoEngine 0.8.2 (ede9fcf)</th>
<th>MongoMallard (478062c)</th>
<th>Speedup</th>
</tr>
<tr>
<td>Doc initialization</td>
<td>52.494us</td>
<td>25.195us</td>
<td>2.08x</td>
</tr>
<tr>
<td>Doc getattr</td>
<td>1.339us</td>
<td>0.584us</td>
<td>2.29x</td>
</tr>
<tr>
<td>Doc setattr</td>
<td>3.064us</td>
<td>2.550us</td>
<td>1.20x</td>
</tr>
<tr>
<td>Doc to mongo</td>
<td>49.415us</td>
<td>26.497us</td>
<td>1.86x</td>
</tr>
<tr>
<td>Load from SON</td>
<td>61.475us</td>
<td>4.510us</td>
<td>13.63x</td>
</tr>
<tr>
<td>Save to database</td>
<td>434.389us</td>
<td>289.972us</td>
<td>2.29x</td>
</tr>
<tr>
<td>Load from database</td>
<td>558.178us</td>
<td>480.690us</td>
<td>1.16x</td>
</tr>
<tr>
<td>Save/delete big object to database</td>
<td>98.838ms</td>
<td>65.789ms</td>
<td>1.50x</td>
</tr>
<tr>
<td>Serialize big object from database</td>
<td>31.390ms</td>
<td>20.265ms</td>
<td>1.55x</td>
</tr>
<tr>
<td>Load big object from database</td>
<td>41.159ms</td>
<td>1.400ms</td>
<td>29.40x</td>
</tr>
</table>
| | MongoEngine | MongoMallard | Speedup |
|---|---|---|---|
| Doc initialization | 10.113us | 3.219us | 3.14x |
| Doc getattr | 0.086us | 0.086us | 1.00x |
| Doc setattr | 0.549us | 0.211us | 2.60x |
| Doc to mongo | 5.991us | 3.181us | 1.88x |
| Load from SON | 12.094us | 0.685us | 17.66x |
| Save to database | 259.094us | 218.945us | 1.18x |
| Load from database | 260.192us | 246.576us | 1.06x |
| Save/delete big object to database | 18.510ms | 8.925ms | 2.07x |
| Serialize big object from database | 4.058ms | 2.346ms | 1.73x |
| Load big object from database | 11.205ms | 0.655ms | 17.11x |

See [tests/benchmark.py](https://github.com/elasticsales/mongoengine/blob/master/tests/benchmark.py) for source code.

0 comments on commit 9ccbf8e

Please sign in to comment.