Add framework to measure code base performance β¨ π #558
Add framework to measure code base performance β¨ π #558RobertoPrevato merged 14 commits intomainfrom
Conversation
Add code to benchmark the performance of BlackSheep source code, to monitor its performance across commits
|
Blacksheep performs best in Python 3.11! Why not 3.13? |
|
@bymoye I was surprised, too. I have no idea. But I think it must be related to CPython itself, because I executed the tests on the same commit. I am pretty satisfied with what I did with these benchmarks, the worklow is pretty cool! π |
|
However, the best performance in terms of memory consumption is with:
ππΌ The worse in terms of memoy consumption:
ππΌ |
This is very strange... I was under the impression that Linux systems should perform best... maybe it has something to do with the memory management mechanism of each system? |
|
I find it strange, too. The specs for GitHub runners are the same for Windows and Linux. macOS has less resources and I got better results at each run. |
|
Hi, @RobertoPrevato I did some research on the possible reason, maybe the Related documentation: memory_full_info Maybe you should use |
|
Hi @bymoye |
Use `export PYTHONOPTIMIZE=1`. Address #558 (comment)
|
@bymoye I'll check more another day. |
|
I used The following results were obtained: https://github.com/bymoye/BlackSheep/actions/runs/14961845051 |
Thanks, very much appreciated. You are correct that USS should be used here. I would add garbage collection before each function execution: while time.time() - start_time < 30: # timeout=30 seconds
+ gc.collect()
wrapper()The results of the
|
benchmark-reportsartifact from the GitHub Workflow to see it in action. https://github.com/Neoteroi/BlackSheep/actions/runs/14950087869Tip
The
benchmark-reportsartifacts include Excel files with tables and charts.