firestore: misc.ts: further improved performance of UTF-8 string comparison logic by dconeybe · Pull Request #9143 · firebase/firebase-js-sdk (original) (raw)

dconeybe added a commit to googleapis/nodejs-firestore that referenced this pull request

Jul 7, 2025

@dconeybe

`[fix: Improve performance of the UTF-8 string comparison logic.](/googleapis/nodejs-firestore/commit/5667e5c3c6c7deea07166a2e6cdf3ac86af09e0c "fix: Improve performance of the UTF-8 string comparison logic.

The semantics of this logic were originally fixed by #2275, but this fix caused a material performance degradation, which was then improved by #2299 The performance was, however, still suboptimal, and this PR further improves the speed back to close to its original speed and, serendipitously, simplifies the algorithm too.

This commit is a port of https://github.com/firebase/firebase-js-sdk/pull/9143") `

[5667e5c](/googleapis/nodejs-firestore/commit/5667e5c3c6c7deea07166a2e6cdf3ac86af09e0c)

The semantics of this logic were originally fixed by #2275, but this fix caused a material performance degradation, which was then improved by #2299 The performance was, however, still suboptimal, and this PR further improves the speed back to close to its original speed and, serendipitously, simplifies the algorithm too.

This commit is a port of firebase/firebase-js-sdk#9143