diff options
author | Abseil Team <absl-team@google.com> | 2018-08-27 14:53:25 -0400 |
---|---|---|
committer | Gennadiy Civil <misterg@google.com> | 2018-08-28 16:53:30 -0400 |
commit | 167c5e8188beb5dae002ac7571457e3c26eb6a3f (patch) | |
tree | 3ac7d65d7a5d9eb4be3883cd3032d29cd93e1e21 /googlemock/scripts/generator/cpp | |
parent | 1bb76182caee8239b71b9d6d21f479014d37ad5b (diff) | |
download | googletest-167c5e8188beb5dae002ac7571457e3c26eb6a3f.tar.gz googletest-167c5e8188beb5dae002ac7571457e3c26eb6a3f.tar.bz2 googletest-167c5e8188beb5dae002ac7571457e3c26eb6a3f.zip |
Googletest export
Fix Theta(N^2) memory usage of EXPECT_EQ(string) when the strings don't match.
The underlying CalculateOptimalEdits() implementation used a simple
dynamic-programming approach that always used N^2 memory and time. This meant
that tests for equality of large strings were ticking time bombs: They'd work
fine as long as the test passed, but as soon as the strings differed the test
would OOM, which is very hard to debug.
I switched it out for a Dijkstra search, which is still worst-case O(N^2), but
in the usual case of mostly-matching strings, it is much closer to linear.
PiperOrigin-RevId: 210405025
Diffstat (limited to 'googlemock/scripts/generator/cpp')
0 files changed, 0 insertions, 0 deletions