Home / Companies / Sentry / Blog / Post Details
Content Deep Dive

Next Halloween I’m dressing as O(n^2)

Blog post from Sentry

Post Details
Company
Date Published
Author
Hector Dearman and Trevor Elkins
Word Count
1,222
Company Posts That Month
9
Language
English
Hacker News Points
-
Post removed?
No
Summary

A recent incident highlighted the pitfalls of O(n^2) algorithms in production, as a step in a size analysis process for mobile apps unexpectedly increased from seconds to 12 minutes. This slowdown was attributed to inefficient deobfuscation logic in Python, which led to billions of iterations due to the quadratic growth of operations as the number of classes increased. After optimizing the code with better data structures, the runtime was reduced significantly. A similar issue occurred in an iOS app analysis, where a cache was not being utilized, resulting in a slow O(n^2) operation in a C++ library. The problem was exacerbated by an unusual increase in data size, revealing the dormant inefficiency. These cases underscore the importance of scrutinizing and optimizing O(n^2) algorithms, which can be deceptively fast in testing but problematic in production, aligning with performance expert Bruce Dawson's insights on poorly scaling algorithms.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.