summaryrefslogtreecommitdiff
path: root/include/ScopedJavaUnicodeString.h
diff options
context:
space:
mode:
authorTobias Thierer <tobiast@google.com>2017-04-04 20:59:26 -0700
committerTobias Thierer <tobiast@google.com>2017-04-04 21:37:25 -0700
commitf806f3a493cd2f6a2ee1287abb5f7705ffda3d42 (patch)
tree61e72c95241b8de5b137c15cd2e38418d48c60d6 /include/ScopedJavaUnicodeString.h
parent4c585da0b1c768551ac48c98e2ca3b406e1fce4b (diff)
Upstream comparison tool: Output relative % difference vs upstream
Before this CL, the upstream comparison tool only produced an *absolute* measure of the difference between a file and its upstream version, namely the edit distance (minimum number of lines to add/remove/replace to transform the content of one file into the other's). After this CL, the tool also notes the *relative* difference, using the formula: edit_distance / max(N, M) where N and M are the number of lines in the two files. - A relative distance of 0% means the files are identical. - A relative distance of 100% can mean that one file is empty (the other file has additional lines), or that all lines are different, or a mixture of the two (e.g. a file being twice as long as the other but with no lines in common). The following more complex approaches were also implemented: - Use the number of lines matched (from the calculation of the edit distance) in the relative distance formula. - Compute the edit distance in time O((N+M)*D*log(D)) rather than O(N*M) by restricting the search to at most D insertions/deletions and performing a one-sided binary search for D, where D is the edit distance. However, those approaches: - involved more complex code - were slower or at least not faster in practice - yielded nearly the same output as this simpler approximation Therefore, this CL only contains the simpler code based on the simpler formula. The tool takes about 18min20sec to compare all ojluni .java files against three upstreams. Test: oj_upstream_comparison.py --upstream_root /tmp/openjdk Change-Id: I6fda8b3f389f45affd920107718d0e9fe2973e9f
Diffstat (limited to 'include/ScopedJavaUnicodeString.h')
0 files changed, 0 insertions, 0 deletions