Coder Social home page Coder Social logo

Comments (7)

dantownsend avatar dantownsend commented on August 28, 2024 1

Here's a repo in case you feel like doing some performance testing:

https://github.com/piccolo-orm/piccolo_performance

from piccolo.

dantownsend avatar dantownsend commented on August 28, 2024

@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.

aminalaee avatar aminalaee commented on August 28, 2024

@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.

dantownsend avatar dantownsend commented on August 28, 2024

@aminalaee Yeah, that makes sense. Do you think the benchmarks should be part of this repo, or a separate repo?

from piccolo.

aminalaee avatar aminalaee commented on August 28, 2024

@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.

dantownsend avatar dantownsend commented on August 28, 2024

Sounds like a good plan. It would be nice to have both, but having either of them would be useful.

from piccolo.

aminalaee avatar aminalaee commented on August 28, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.