Native Implementation vs Wasm for Go, Python and Rust Benchmark

In 2024 you would hear the term wasm pop up now and then. It is not exactly new, but it’s gaining more traction due to wider ecosystem in recent years. Wasm stands for web assembly, essentially it’s a format that allows you to execute binaries in browser runtimes. Imagine creating a website, and you need to implement a specific function. The problem is that it is much easier to implement this function in Go, but your website is written in typescript. This happens to be a static site, so a backend shouldn’t be necessary. You can either: ...

December 4, 2024 · 3 min · Karn Wong

Calling C from Go, Python and Rust benchmark

There’s a consensus that generally, c is very fast, and python is very slow. But if we are talking about go and rust, you would find that rust is slightly faster than go. So from fastest to slowest: c, rust, go, python. But what if you have go, python and rust calling c function? There would be more overhead, but how much? Calling C from Go, Python and Rust Stats ...

October 12, 2024 · 2 min · Karn Wong

LLM serving latency benchmark

After the rise of ChatGPT in 2023, these days most people are familiar with the concept of LLM - Large Language Model. If you are LLM users, things are looking bright because there are gazillion options for you to choose from. But if you are on the other side - creating and deploying LLMs, there are certain things you need to think about. For one, your implementation team would have languages/frameworks they specialize in, so that’s already a constraint you have to work with when designing a solution. ...

October 9, 2024 · 2 min · Karn Wong

Hello World API Performance Benchmark (Go, Node, Python, Rust)

Correction 2024-09-21: after using multi-stage build, Node image size dropped from 1.1GB to 130MB. The first programming language I achieved proficiency was Python, so for the longest time I’ve been using it to do most stuff. Last year I picked up Go, and I had a blast with it. This month I picked up Rust for data/ml works, and so far I was very impressed. It got me thinking - it’s been said multiple times is Python is slower than compiled languages, and Node is very easy to use but uses a lot of memory. Since I can code in multiple languages, why not do a simple API benchmark? So here’s the results. ...

September 20, 2024 · 3 min · Karn Wong

Streamlit load test performance

Streamlit is well-loved by many people, especially among data folks due to the fact that it does not require prior web programming knowledge to get started. Popular use cases for streamlit can be anything from a quick machine learning application poc or internal dashboards. But what if you want to create a production deployment? Would streamlit still be a viable option? Experiment setup For a production deployment, let’s assume there are 500 concurrent users. For a single-page streamlit with a chat box taking 3 seconds to return a single-paragraph message: ...

September 7, 2024 · 2 min · Karn Wong