FrameworkBenchmarks icon indicating copy to clipboard operation
FrameworkBenchmarks copied to clipboard

Feat/litestar

Open pythonhubdev opened this issue 6 months ago • 13 comments

feat: Add Litestar Framework Implementation

This PR introduces comprehensive benchmarks for the Litestar framework across multiple configurations and server implementations.

Key Changes

  • 🚀 Added Litestar benchmark implementations for:
    • ASGI Servers: Uvicorn, Granian, Socketify
    • Protocols: HTTP/1.1, WebSockets
    • Templating: Jinja2 integration
    • ORJSON optimizations for JSON serialization

Removed:

  • Removed ujson5 and made orjson as default since it's mentioned in ujson docs itself to migrate.
  • Removed separate configurations for orjson
  • Removed support for hypercorn since it's been unmaintained

New Server

  • Added support for Granian server

pythonhubdev avatar May 19 '25 10:05 pythonhubdev

Given using uvicorn workers with gunicorn is deprecated, might be a good idea not to implement such variants for new implementations..

gi0baro avatar May 21 '25 13:05 gi0baro

Sure will keep do this during the implementation

pythonhubdev avatar May 21 '25 16:05 pythonhubdev

@joanhey @gi0baro need some help here actions are failing fixed the parts can you help me where exactly should I fix and how can I run the test in my local?

pythonhubdev avatar May 22 '25 14:05 pythonhubdev

@joanhey @gi0baro need some help here actions are failing fixed the parts can you help me where exactly should I fix and how can I run the test in my local?

For the Granian part, it looks like you're copying the wrong requirements file in the docker image:

litestar-granian: Exception: COPY failed: file not found in build context or excluded by .dockerignore: stat requirements-hypercorn.txt: file does not exist

https://github.com/TechEmpower/FrameworkBenchmarks/pull/9905/files#diff-7c69ad07ef0ff402b043234c1bf57f528611dd38a5c99c5778255b355ee6736bR10

Also, I'm pretty sure you can't use HTTP/2 only.

gi0baro avatar May 22 '25 14:05 gi0baro

@gi0baro all the other issues are fixed now the major issue is socketify web not able to figure out what the issue is.

pythonhubdev avatar May 22 '25 15:05 pythonhubdev

@gi0baro all the other issues are fixed now the major issue is socketify web not able to figure out what the issue is.

You might want to ping @cirospaciari on that.

gi0baro avatar May 22 '25 15:05 gi0baro

Sure @cirospaciari can you please help me out here?

pythonhubdev avatar May 22 '25 15:05 pythonhubdev

Sure @cirospaciari can you please help me out here?

Sure whats the problem you are encountering? wanna DM me in discord?

cirospaciari avatar May 22 '25 17:05 cirospaciari

Sure will text you on discord and also socketify discord link is not working as well

pythonhubdev avatar May 22 '25 17:05 pythonhubdev

Sure will text you on discord and also socketify discord link is not working as well

https://discord.gg/uVckUZCx Will update the oficial link thanks

cirospaciari avatar May 22 '25 17:05 cirospaciari

Thanks have texted you on Discord.

pythonhubdev avatar May 22 '25 17:05 pythonhubdev

Hi @pythonhubdev

To test in local:

./tfb --mode verify --test litestart
./tfb --mode verify --test litestart-granian

./tfb --mode verify --test litestart litestar-granian litestar-gunicorn 

# for help
./tfb -h

joanhey avatar May 31 '25 21:05 joanhey

Will try this out. @cirospaciari any update on the socketifyweb part?

pythonhubdev avatar Jun 03 '25 16:06 pythonhubdev

@cirospaciari any update on this PR?

pythonhubdev avatar Jul 21 '25 06:07 pythonhubdev

Hi @joanhey issues are fixed can you please review it and let me know if any more changes are required? I have removed the socketifyweb-pypy since it was having some issues.

pythonhubdev avatar Aug 06 '25 13:08 pythonhubdev