Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • nahomy/diffoscope
  • reproducible-builds/diffoscope
  • eighthave/diffoscope
  • justinkb-guest/diffoscope
  • xavierbriand-guest/diffoscope
  • mattia/diffoscope
  • gaviriar-guest/diffoscope
  • amurzeau/diffoscope
  • marmarek/diffoscope
  • wjt/diffoscope
  • mgedmin/diffoscope
  • aparcar-guest/diffoscope
  • chabala/diffoscope
  • jelle/diffoscope
  • ygy/diffoscope
  • grahamc-guest/diffoscope
  • emaste-guest/diffoscope
  • bradfordboyle/diffoscope
  • kerlyn-guest/diffoscope
  • aarushi-guest/diffoscope
  • weatherwaxed-guest/diffoscope
  • vagishagupta23-guest/diffoscope
  • soumya-guest/diffoscope
  • m-boselli-guest/diffoscope
  • Vibhu-guest/diffoscope
  • akanksham-guest/diffoscope
  • JPEWhacker-guest/diffoscope
  • mikeroyal-guest/diffoscope
  • marc-guest/diffoscope
  • lamby/diffoscope
  • pabs/diffoscope
  • sangy-guest/diffoscope
  • dr_rtx/diffoscope
  • danielfullmer/diffoscope
  • FrazerClews/diffoscope
  • xXxrAinZyian/diffoscope
  • jelmer/diffoscope
  • ratschance/diffoscope
  • jimis/diffoscope
  • rclobus-guest/diffoscope
  • jgart/diffoscope
  • zach.welch.timesys/diffoscope
  • SmileyKeith/diffoscope
  • rbalint/diffoscope
  • zbyszek-guest/diffoscope
  • benjaminp/diffoscope
  • JRomain/diffoscope
  • trofi/diffoscope
  • blmaier-col/diffoscope
  • spillner/diffoscope
  • primeos-guest/diffoscope
  • qyliss/diffoscope
  • obfusk/diffoscope
  • cbaines-guest/diffoscope
  • thesamesam/diffoscope
  • AkihiroSuda/diffoscope
  • efraim-guest/diffoscope
  • dkg/diffoscope
  • Raviu/diffoscope
  • tchx84/diffoscope
  • fridtjof/diffoscope
  • tie/diffoscope
  • felixonmars/diffoscope
  • ernstki/diffoscope
  • sethmlarson/diffoscope
  • Vekhir2/diffoscope
  • amarshall/diffoscope
67 results
Show changes
Commits on Source (4)
......@@ -93,8 +93,9 @@ def compare_files(file1, file2, source=None, diff_content_only=False):
# Specialize the files first so "has_same_content_as" can be overridden
# by subclasses
specialize(file1)
specialize(file2)
with profile("specialize", "specialize"):
specialize(file1)
specialize(file2)
force_details = Config().force_details
with profile("has_same_content_as", file1):
......
......@@ -32,6 +32,7 @@ from multiprocessing.dummy import Queue
from .tools import get_tool_name, tool_required
from .config import Config
from .profiling import profile
from .tempfiles import get_temporary_directory
DIFF_CHUNK = 4096
......@@ -386,7 +387,7 @@ def color_unified_diff(diff):
DIFFON = "\x01"
DIFFOFF = "\x02"
MAX_WAGNER_FISCHER_SIZE = (
1024 # any higher, and linediff takes >1 second and >200MB RAM
256 # any higher, and linediff takes >1 second and >200MB RAM
)
......@@ -450,6 +451,7 @@ def linediff_wagnerfischer(s, t):
for j in range(1, n + 1):
d[0][j] = (j, (0, j - 1))
# NB. This loop is O(len(s) * len(t))
for i in range(1, m + 1):
for j in range(1, n + 1):
if s[i - 1] == t[j - 1]:
......@@ -611,7 +613,8 @@ class SideBySideDiff:
type_name = "unmodified"
else:
type_name = "changed"
s1, s2 = linediff(s1, s2, self.diffon, self.diffoff)
with profile("diff", "linediff"):
s1, s2 = linediff(s1, s2, self.diffon, self.diffoff)
yield "L", (type_name, s1, self.line1, s2, self.line2)
......
......@@ -16,9 +16,11 @@
# You should have received a copy of the GNU General Public License
# along with diffoscope. If not, see <https://www.gnu.org/licenses/>.
import os
import logging
from ..profiling import profile
from ..utils import format_bytes
from .text import TextPresenter
from .json import JSONPresenter
......@@ -102,6 +104,17 @@ class PresenterManager:
with profile("output", name):
data["klass"].run(data, difference, parsed_args)
size = "n/a"
if os.path.isfile(data["target"]):
size = format_bytes(os.path.getsize(data["target"]))
logger.debug(
"Generated %r output at %r (size: %s)",
name,
data["target"],
size,
)
def compute_visual_diffs(self):
"""
Don't waste time computing visual differences if we won't use them.
......