You are browsing as a guest. Sign up (or log in) to start making projects!

2h 33m 25s logged

I’ve been optimizing the framework today, here’s what changed:

1. Massive performance boosts

I managed to go from 2279 requests/sec to 3929, which is 72% increase. After running new benchmarks, I’ve also surpassed FastAPI by ~24% (recorded 3154 requests/sec). I did this by minimizing the amount of logging that is done per request (can be configured). Because my log manager is fairly heavy, this helped a lot.

2. Better dependency resolver

The dependency resolver I had for services was okay, but it lacked 2 important features: Optional dependencies and explicit order.

The old system was simply:

Service.Export(MyPlugin, depends_on=["HTTPRouter"])
Which is fine for simple plugins, but you start doing more complex work, you’ll hit the limits fast.

The new system now handles:

  • ? at the end makes the dependency optional
  • :after tells the dependency to start AFTER your plugin, not before. Essentially adds your plugin as the target’s dependency.

3. Split onStart

Before, onStart handled both starting database and HTTP servers, bots. Because of this, I’ve decided to split the setup logic and startup logic into 2: onSetup and onStart

4. Other changes

I also removed some legacy aliases for methods.

0
2

Comments 0

No comments yet. Be the first!