Hyperlambda is 17 times faster than Python with Flask

Hyperlambda is 17 times faster than Python with Flask

I just measured the performance of Python with Flask, and compared it towards Magic with Hyperlambda, and the results should shock you. Hyperlambda and Magic is on average 17 times faster than Flask. I did the same test where I measure Fast API versus Hyperlambda, except of course I used Flask instead of Fast API, and the results was as follows.

  • Flask executed between 2,324 and 3,616 HTTP requests, an average of 4,778
  • Hyperlambda executed between 78,000 and 83,361 requests, an average of 80,680

The test creates 50 async tasks or threads, and basically just hammers a CRUD read endpoint that's returning Artist items from my chinook database. The database was copied and pasted from the Hyperlambda solution, so it's the exact same database. The machine is the same, a MacBook Pro M3, and you can find the code below if you wish to reproduce what I did.

Code

To test you can use the code from my Fast API article, but instead of creating a Fast API endpoint you use the following code.

from flask import Flask, jsonify
import sqlite3

app = Flask(__name__)

# Helper function to query SQLite
def get_all_artists():
    conn = sqlite3.connect("Chinook.db")
    conn.row_factory = sqlite3.Row   # Enables dict-like rows
    cursor = conn.cursor()

    cursor.execute("SELECT ArtistId, Name FROM Artist")
    rows = cursor.fetchall()

    conn.close()

    return [dict(row) for row in rows]


@app.route("/artists", methods=["GET"])
def artists():
    return jsonify(get_all_artists())


if __name__ == "__main__":
    app.run(debug=False, port=5001)

The above is a standard solution returning database items using Flask. In case you don't want to check out my previous blog, you can find the "stress testing" code below.

import asyncio
import aiohttp
import time

URL = "http://127.0.0.1:5001/artists"
#URL = "http://127.0.0.1:5000/magic/modules/chinook/artist"

async def worker(session, stop_time, counters):
    while time.time() < stop_time:
        try:
            async with session.get(URL) as resp:
                if resp.status == 200:
                    counters["ok"] += 1
                else:
                    counters["fail"] += 1
        except Exception:
            counters["fail"] += 1

async def main():
    duration = 30  # seconds
    concurrency = 50  # number of parallel workers

    counters = {"ok": 0, "fail": 0}
    stop_time = time.time() + duration

    async with aiohttp.ClientSession() as session:
        tasks = [
            worker(session, stop_time, counters)
            for _ in range(concurrency)
        ]
        await asyncio.gather(*tasks)

    total = counters["ok"] + counters["fail"]
    print(f"Requests sent: {total}")
    print(f"Successful:     {counters['ok']}")
    print(f"Failed:         {counters['fail']}")
    print(f"Req/sec:        {total / duration}")

if __name__ == "__main__":
    asyncio.run(main())

To test the Hyperlambda endpoint, change the URL variable you're using, run the test 3 times towards each endpoint, and calculate the average of each run. This should give you a representative average value for each example. To generate the Hyperlambda code, I simply used the CRUD generator to wrap my chinook database. Remember to turn off authorisation requirements before generating your CRUD endpoints to get the equivalent code, and make sure you either pass in limit=1 as a query paremeter to the endpoint, or edit the endpoint manually to return all records. Otherwise the Hyperlambda code will only return 25 items.

Interestingly, Flask seems to be able to accept more throughput than Fast API, but it of course becomes equivalent to "nothing" compared to the amount of throughput Hyperlambda can deal with.

Wrapping up

A Volkswagen Beetle can probably do 120KM per hour. Multiplying that number by 17, and you get 2,040KM per hour. That's about the same as the maximum speed of a modern fighter jet. Implying ...

Hyperlambda versus Python and Flask, is like trying to race a fighter jet with a Volkswagen

As in, yes, the performance difference between Flask and Hyperlambda is the same as the performance difference between a 20 year old Volkswagen and a modern fighter jet!

Thomas Hansen

Thomas Hansen

I am the CEO and Founder of AINIRO.IO, Ltd. I am a software developer with more than 25 years of experience. I write about Machine Learning, AI, and how to help organizations adopt said technologies. You can follow me on LinkedIn if you want to read more of what I write.

This article was published 24. Nov 2025

Hyperlambda is 20 times faster than Fast API and Python

I just conducted a performance test between Hyperlambda and Python's Fast API, and Hyperlambda has 20 times better performance.

Generate your Next CRM AI Agent with No-Code

With Magic Cloud you can 'generate' a CRM AI agent using no-code, allowing you to have an AI agent dealing with your existing or new CRM

Google Antigravity versus Magic Cloud

We tested Google's Antigravity AI code generator platform, to see how it performs in comparison to Magic. Here's our rundowm of the differences.

AINIRO.IO's Logo

AINIRO.IO Ltd is an independently owned company in Cyprus, 100% owned and operated by Thomas Hansen, and that's how it stays!

Copyright © 2023 - 2025 AINIRO.IO Ltd