Instead of comparing two large blocks of text character-by-character, hash each one and compare the (much shorter) digests — identical hashes mean identical content, with a collision probability low enough to ignore for SHA-256 in this kind of use case. This is a common pattern for deduplicating stored config, caching by content, or detecting whether a file changed since the last time you hashed it.
Paste a version of the text below, note the hash, then paste a later version — if the hash changes, the content changed.