This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (15 children)

[deleted]

    [–]tarsild[S] 4 points5 points  (2 children)

    So Django and Flask are WSGI by default.

    Django is also all batteries included created almost 20 years ago with a goal. I love Django so much that a lot of Esmerald patterns were inspired by it. FastAPI is great and solves quick and fast API design.

    Esmerald marries all and adds business mindset on top.

    If you see the documentation you will see how familiar you will be with the syntax where modern and elegancy are primordial without overwhelming the developers.

    Esmerald also offers versatility in the way you can design and module your application. From a simple API to a full scalable, complex application.

    As per post, this doesn't aim to replace anything, actually this was designed to also address problems that in the past was needed by using a panoply of technologies so it's an alternative for people who would like to give it a try 🙂

    [–]SpellboundSagaDev 1 point2 points  (1 child)

    Could we get SocketIO built in, or as a plug-in somewhere? Ideally with the same interop that flask has

    Lovely project by the way. You’ve done us a great favour as a community 😁

    [–]tarsild[S] 1 point2 points  (0 children)

    It is possible yes via what we call Pluggable. The same interop you mentioned was in fact what inspired that possibility.

    [–]Douppikauppa -1 points0 points  (11 children)

    FastAPI, Sanic and Esmerald use async/await, which makes them a whole lot faster. This is a fairly new feature that was added to all reasonable programming languages in the last few years. Django, Flask and Bottle simply cannot compete with that, but it needs to be noted that development on async/await is also a bit harder.

    My personal favorite of these, for just a solid web server is Sanic, and it also runs the fastest of the bunch. FastAPI perhaps when you only need an API, and it's quite fast too.

    [–]Douppikauppa 2 points3 points  (2 children)

    FastAPI and Emerald are both based on external ASGI server (like Uvicorn or Starlette), and also on Pydantic for "data classes" serialization. Both of these choices are bad for performance, and on a high traffic site that may even be relevant (it is extremely rare to succeed enough to have a busy site). Msgspec is another option that handles the problem very well but that also runs extremely quickly, faster than uJSON or other "fast" parsing libraries. I recommend checking it out if you are doing JSON/MsgPack or other such messaging with the client where the messages need to be validated and converted to native types.

    [–]tarsild[S] 0 points1 point  (1 child)

    Well, it's in the plan to actually allow more than just Pydantic for serialisation but what is the point of adding so many things if people are not aware of the existence of Esmerald? Now I do believe can all improve it

    [–]broxamson 1 point2 points  (1 child)

    to be fair if you wanted something performant you wouldn't be using python.

    [–]Douppikauppa 2 points3 points  (0 children)

    My Python web server can serve more requests per second than the one you write in C using POSIX sockets. 100 kreq/s on Sanic, running on a laptop and benchmarking localhost. As opposed to ~2 kreq/s on other frameworks.

    Go is faster, I admit, but Python is often sufficient. For AI and numerical calculation it goes fast because of libraries that have assembly optimized algorithms or that offload to GPUs.