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

Faster spark workloads with comet

For big data processing, spark is still king. Over the years, many improvements have been made to improve spark performance. Databricks themselves created photon, a spark engine that can accelerate spark queries, but this is proprietary to Databricks. Other alternatives do exist (see here for more details), but they are not trivial to setup. But if you use Apache Arrow DataFusion Comet, surprisingly it does not take much time at all to setup. Comet stands on arrow, a data format growing in popularity. ...

April 7, 2024 · 2 min · Karn Wong