Comments (7)
Here's a repo in case you feel like doing some performance testing:
https://github.com/piccolo-orm/piccolo_performance
from piccolo.
@aminalaee I like the idea of having benchmarks to catch performance regressions made by changes to the Piccolo codebase.
I find them quite tricky to implement though, as there's no guarantees around the performance of the CI infrastructure, so one build might be slower than another, without it being anything to do with the code being tested.
As for testing it against other frameworks, it's hard to know what to test. Piccolo is fastest in this situation:
# `freeze` caches a lot of the work in generating the SQL:
QUERY = MyTable.select().output(as_json=True).freeze()
async def some_endpoint(request):
# Letting Piccolo serialise the JSON means orjson will be used if available, which is super fast.
data = await QUERY.run()
return Response(data, content_type="application/json")
Other frameworks might not have comparable features, or might have their own performance optimisations we're not aware of.
What do you think?
from piccolo.
@dantownsend
I think for testing different frameworks benchmarking basic INSERT/SELECT/UPDATE/DELETE without any configuration can be a good start. I agree that optmizing each framework can be complicated and probably unfair to others.
For regression testing Piccolo I think we can try pytest-benchmark and if the load of Github server affects the numbers go for dedicated hardware for testing. But I guess increasing number of queries and maybe getting average values from the tests can minimize that effect.
from piccolo.
@aminalaee Yeah, that makes sense. Do you think the benchmarks should be part of this repo, or a separate repo?
from piccolo.
@dantownsend I think for comparing different frameworks we can have a separate repo so anyone can see how that works and run them locally. We would show benchmarks in Piccolo docs then. That would keep Piccolo's history clean of benchmarking commits.
And for Piccolo regression tests I think pytest-benchnark
can do a good job with a github workflow but as you said this is a bit tricky so needs more testing.
If you think we need both of them we can do them separately.
from piccolo.
Sounds like a good plan. It would be nice to have both, but having either of them would be useful.
from piccolo.
@dantownsend If we want the extra repository for comparisons, then please create the repo and I'll start an MR to get it started
from piccolo.
Related Issues (20)
- Replace deprecated `startup` and `shutdown` events in asgi templates HOT 1
- Document how to achieve a `OneToOneField` in Piccolo
- Use `TableTest` to cut down boiler plate in tests
- Be able to hardcode migrations as fake
- Reverse relations fetching HOT 11
- Fix typo in `Email` docstring
- Improve `LazyTableReference`
- Unable to import Max, Sum in piccolo[postgres]==0.113.* HOT 4
- is there a debug flag echo raw sql ? HOT 1
- Compound unique indexes HOT 2
- M2M without on_conflict HOT 2
- Joins HOT 2
- Fix docs for `update_password`
- Better error messages for min password length
- Table names compatibility HOT 2
- Refactor `_process_results` to support new DB engines
- Can we prevent default values from being inserted when `null=False`? and give ValueError? HOT 2
- Object.refresh() mutates relations HOT 7
- Incomplete "Get the tests running" documentation HOT 6
- Add Piccolo `TestCase` subclasses
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from piccolo.