Fallow TypeScript analysis cover

How Fallow Analyzes TypeScript in Under a Second

Fallow is a codebase analyzer written in Rust for TypeScript and JavaScript projects, created by Bart Waardenburg. I’m an open source contributor to the project. It finds unused files, dead exports, unlisted dependencies, code duplication, circular dependencies, and complexity hotspots. It’s a Rust alternative to Knip. On real-world projects, it runs 6-46x faster than Knip with 4-11x less memory. It analyzes Next.js (20,000+ files) in 1.5 seconds, where Knip doesn’t even finish. Here’s how the internals work. ...

April 5, 2026 · 5 min · Muhammad Hassan Raza
Django ORM optimization diagram

Optimizing Django ORM Queries for Large Applications

Introduction As my POS system scaled, performance bottlenecks became increasingly apparent. Customers began complaining about slow bill generation times, which made checkout frustratingly sluggish. After profiling my Django APIs, I discovered that inefficient ORM queries were causing unnecessary database overhead, leading to significant slowdowns. This prompted a deep dive into ORM optimizations to reduce query execution time and improve the overall user experience. In this post, I’ll share how I optimized my Django ORM queries using select_related, prefetch_related, bulk operations, and query profiling tools to enhance the efficiency of my refund API and bill generation process. ...

February 17, 2025 · 3 min · Muhammad Hassan Raza
Django signal optimization diagram

Optimizing Django Signals for Efficient Ledger Recalculations

Introduction When dealing with financial transactions in Django applications, maintaining an accurate ledger is critical. However, inefficient signal handling can lead to performance bottlenecks. In this article, we’ll explore an optimized approach to recalculating ledger balances while ensuring minimal database impact. The Problem A typical ledger system requires recalculating balances when transactions are inserted, updated, or deleted. Using Django signals, many implementations trigger redundant recalculations, causing excessive database queries and slowing down the application. ...

February 15, 2025 · 2 min · Muhammad Hassan Raza
Invoice search performance cover

The Invoice Page That Took 4 Seconds to Search

In Polaris, the POS system I built for retail shops, the invoice page has a product search bar. A cashier types a product name, results appear, they click to add it to the invoice. Simple. Except it wasn’t. Every keystroke fired an API call. On a shop with 500 products, search took 3-4 seconds because each request hit the database, serialized the response, and traveled back over the network. Cashiers were waiting on every single search. During rush hours, this was painful. ...

February 11, 2025 · 2 min · Muhammad Hassan Raza