USA flag on a boat

The land of good deals

“The apartment rents are high right now, but we got a good deal”, he said, smiling alongside his roommate. Another friend said, “We got a good deal on a car loan, so, we took the loan, it’s good for building credit history to buy a house later”. “The instructor was super-happy with our amazing group. He taught us a few special tricks that he says he rarely taught.” “The bartender was super-nice to us and made us a special drink” ...

Oslo Opera House

Two days in Oslo, Norway

Oslo is one of the weirdest Nordic cities that I visited. It is dull compared to Copenhagen or even Stockholm . The Baumol effect of the oil-funded economy makes it a really expensive place to visit as well. Infact, it is one of the few cities which feel more expensive than San Francisco. To get from the airport to Oslo city, just take a 124NOK train ride. There is a faster 240NOK train ride as well which isn’t worth it. ...

FastAPI vs Flask performance comparison

FastAPI vs Flask performance comparison

If you are running Python in production , you will almost certainly have to decide which web framework to use. Let’s consider a rudimentary Hello world based test comparing the performance of two popular web frameworks for Python - FastAPI and Flask . I will intentionally use Docker for benchmarking as most deployments today will explicitly or implicitly rely on Docker. For Flask, I will use this Dockerfile 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 # Build: docker buildx build -t python-flask -f Dockerfile_python . # Size: docker image inspect python-flask --format='{{.Size}}' | numfmt --to=iec-i # Run: docker run -it --rm --cpus=1 --memory=100m -p 8001:8001 python-flask FROM python:3.13-slim AS base WORKDIR /app RUN pip3 install --no-cache-dir flask gunicorn SHELL ["/bin/bash", "-c"] RUN echo -e "\ from flask import Flask\n\ app = Flask(__name__)\n\ \ @app.get('/')\n\ def root():\n\ return 'Hello, World!'\n\ " > /app/web_server.py ENTRYPOINT ["gunicorn", "web_server:app", "--bind=0.0.0.0:8001", "--workers=4", "--threads=32"] And for FastAPI, I will use this ...

Google vs Perplexity

Google Search is losing to Perplexity

Recently, after doing some Google mandated updates of MusicSync , my music player Android application, I received the following error in Android Studio during the build process. Plaintext 1 AAPT2 aapt2-8.8.0-12006047-osx Daemon #1: Daemon startup failed I tried to search for the error on Google, and got zero results . ...

Python

How to run Python in production

My previous article recommended that one should reconsider using Python in production. However, there’s one category of use case where Python is the dominant option for running production workloads. And that’s data analysis and machine learning. Almost all bleeding-edge work in data analysis and machine learning, especially around LLMs, happens in Python. So, here are some of my learnings on how to run Python in production. ...

Liffey River

Two days in Dublin, Ireland

Dublin is a small city. Despite its high per-capita GDP, unlike Singapore or Tokyo , the city feels fairly low-key and more of a middle-affluent country. The official languages are Gaelic and English. To preserve Gaelic, all laws are officially passed in Gaelic! Day 1 The city of Dublin is not huge. You can walk everywhere and even skip public transport. I would recommend starting with a walking tour that gives you a great idea of the city. Rick Steve has great guides as well. ...

Continuous integration ≠ Continuous delivery

Continuous integration ≠ Continuous delivery

GitHub Actions (or GitLab CI) is great for Continuous Integration (CI). However, using it for Continuous Delivery (CD) for docker images isn’t necessary. And there is a better approach.

World's simplest project success heuristic

Here’s a simple project success heuristic. All projects have some element of uncertainty but over time the questions should become more refined. If that’s not happening, then the project is almost certainly failing. The company might still succeed via a pivot but the project is unlikely to. Consider the progression of questions for a consumer (B2C) product. Would anyone use this? Would a million people use this? What’s the total addressable market? Would people pay for this? Is 10$/month too high or can I increase the price further? Notice how questions keep becoming nuanced. ...

Westminster Abbey

London in 5 days

Day 1 - West Minster Start the day with a walking tour that gives you a nice history & geography of the city of London. Many of the royal palaces and crown-related buildings are in the city of “Westminster” which is next door to the City of London. Then head to the British Museum. Like most government-owned museums, it is free to access. However, I would recommend booking a reservation in advance. Rick Steves has a nice audio guide on touring the British Museum that I would recommend. ...

It is hard to recommend Python in production

It is hard to recommend Python in production

I started writing in the 2010s when Python 2 was going to be deprecated and Python 3 was too early to support. Python might have died there and then but was picked up by the data science and machine learning community, so, it survived. Running Python in production comes with various gotchas though. Python is resource-intensive Let’s consider a simple Docker image containing “Hello World”. Dockerfile 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 # Build: docker buildx build -t python-fastapi -f Dockerfile_python . # Size: docker image inspect python-fastapi --format='{{.Size}}' | numfmt --to=iec-i # Run: docker run -it --rm --cpus=1 --memory=100m -p 8000:8000 python-fastapi FROM python:3.12-slim AS base WORKDIR /app RUN pip3 install --no-cache-dir fastapi==0.115.11 uvicorn==0.34.0 SHELL ["/bin/bash", "-c"] RUN echo -e "\ from fastapi import FastAPI\n\ app = FastAPI()\n\ @app.get('/')\n\ async def root():\n\ return {'message': 'Hello World'}\ " > /app/web_server.py ENTRYPOINT ["uvicorn", "web_server:app", "--host=0.0.0.0", "--port=8000", \ "--workers=4", "--limit-concurrency=32"] And a similar web server in Go. ...