{"thread":{"id":"35852","subject":"Turning a test script into something usable in t/perf","startedAt":"2014-02-12T16:26:42Z","lastAt":"2014-02-12T16:26:42Z","messageCount":1,"participants":["David Kastrup"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"234663","messageId":"877g909u0t.fsf@fencepost.gnu.org","threadId":"35852","inReplyTo":null,"subject":"Turning a test script into something usable in t/perf","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2014-02-12T16:26:42Z","receivedAt":"2014-02-12T16:26:42Z","isPatch":false,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"\nHi,\n\nI find that I have little clue about how to convert the following brief\ntest script into some test to place in t/perf:\n\n\n\n#!/bin/sh\nrm -rf /tmp/git-test\nmkdir /tmp/git-test\ncd /tmp/git-test\ngit init\nLIMIT=200000\nyes a|head -$LIMIT >data\nyes b|head -$LIMIT >data2\ngit add data data2\ngit commit -m \"split\"\ngit rm data2\nyes 'a\nb' | head -$(($LIMIT*2)) >data\ngit add data\ngit commit -m \"combined\"\ntime git blame data >/dev/null\n\n\n\nThe variable LIMIT is the deciding factor for determining performance\nwhich, with the code in current master, is rather measurably O(LIMIT^2).\nI think that the current test takes about 15 minutes to complete on my\ncomputer.\n\nObviously, that's sort of excessive: there is little point in choosing\nsizes that show off more than two orders of magnitude in improvement.\n\nNow the pathological cases are lots of small but attributable fragments\nin the blamed source files.  One real-world project that is hit rather\nhard is an alphabetically sorted large list of words that tends to get\ninsertions/deletions of few scattered lines at a time.\n\nShould one aim for an actually pathological case like in this script?\nShould one try benchmarking with one of the stock repositories instead\nthat don't really demonstrate well just how bad the behavior might\nbecome and which code passages are dominant regarding the quadratic\nbehavior?\n\n-- \nDavid Kastrup\n"}]}