gotextdiff icon indicating copy to clipboard operation
gotextdiff copied to clipboard

used extremely large amount of memory

Open siff-duke opened this issue 3 years ago • 0 comments

Just comparing 2 solaris pkginfo output used about 1.5Gb of memory (attached).

	edits := myers.ComputeEdits(span.URIFromPath(""), PrevContent, Content)
	unifiedPatch := gotextdiff.ToUnified("src", "dst", PrevContent, edits)
	var DiffContent = fmt.Sprint(unifiedPatch)

	fmt.Printf("!!!! len(DiffContent):%+v\n", len(DiffContent))
/usr/bin/time -v go run scratch.go
!!!! len(DiffContent):1152378
	Command being timed: "go run scratch.go"
	User time (seconds): 2.07
	System time (seconds): 2.51
	Percent of CPU this job got: 102%
	Elapsed (wall clock) time (h:mm:ss or m:ss): 0:04.46
	Average shared text size (kbytes): 0
	Average unshared data size (kbytes): 0
	Average stack size (kbytes): 0
	Average total size (kbytes): 0
	Maximum resident set size (kbytes): 15095320
	Average resident set size (kbytes): 0
	Major (requiring I/O) page faults: 5
	Minor (reclaiming a frame) page faults: 3793204
	Voluntary context switches: 3058
	Involuntary context switches: 434
	Swaps: 0
	File system inputs: 0
	File system outputs: 5640
	Socket messages sent: 0
	Socket messages received: 0
	Signals delivered: 0
	Page size (bytes): 4096
	Exit status: 0

solaris-sw-pkginfo.txt prev-pkginfo.txt

siff-duke avatar Mar 18 '22 05:03 siff-duke