How further/quicker can I make this solution for a fun hackathon?

Hey :waving_hand: I am new-comer into the language which came to my knowledge while contributing to LavinMQ.

The first opportunity for me to understand the language more deeply is the Brazilian Brawl - an annual country-wide hackathon 4fun with backend challenges. This year the challenge is to write an API that can integrate with another API by which may or may-not be failing.

It’s a great exercise for overall engineering and it’s all allowed.

I am asking wether anyone want’s to nerd about much I can push forward for performance using Crystal.

Limitations:

  • Use only 350MB RAM
  • Use only 1.5vCPU
  • Needs 1 LB
  • Needs 2 Apps
  • Total amount of requests + processed $$ should be consistent with your backend + the processors.

My current solution and performance-points:

  • Crystal 1.17
  • Write API
  • Read API + Worker to integrate/call external APIs.
  • The worker stores in-memory SkipList to run RANGE queries with SUM
  • NGINX load balances writes and ponts READS into the worker.

My code repo: GitHub - lukas8219/rinha-de-backend-2025: Crystal, LavinMQ, NGINX, Circuit Breaker

What I wanted to ask and discuss:

  • How fast can I make the p99?
  • Is there any clear performance issues with my code regarding Crystal best practices?

Hi Lucas!

I believe it will be easier for the community members if you can first share more data from real execution of your code.

What are your current results?

Hii Paulo! Thanks for reaching out.

Let me grab more statistical data. I do have the current results here which are satisfactory but yet a bit inconsistent. I figure it might be something else instead of Crystal so let me dive into it before sharing any numbers and more data