# Diff is too complex to display

**URL:** https://meta.discourse.org/t/diff-is-too-complex-to-display/400810
**Category:** Support
**Created:** [April 16, 2026, 4:49pm UTC](https://meta.discourse.org/t/diff-is-too-complex-to-display/400810 "2026-04-16T16:49:23Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [April 17, 2026, 3:49pm UTC](https://meta.discourse.org/t/diff-is-too-complex-to-display/400810/2 "2026-04-17T15:49:33Z")

</div>

It’s a little [complicated](https://github.com/discourse/discourse/blob/fb075f3f2930f39fb84eaac8abee24ea90539b19/lib/onpdiff.rb) 🤔

So the code sets a **budget** : a maximum number of comparisons it’s allowed to make before it must stop and say “this is too hard.”

**How the budget is calculated?**

- It takes the combined size of the two texts and multiplies by 200. Bigger texts get a bigger budget.
- But there’s a hard ceiling of **2 million** comparisons—no matter how big the texts are, it will never try more than that.

**What happens when the budget runs out?**

- The code raises its hand and says “I give up”—it throws an error (`DiffLimitExceeded`) rather than letting the server grind away for seconds or minutes 😬

---

_[View the full topic](https://meta.discourse.org/t/diff-is-too-complex-to-display/400810)._
