Skip to Content.
Sympa Menu

sm-sorcery-bugs - [SM-Sorcery-Bugs] [Bug 13356] config_query gets slower as CONFIGURE progresses

sm-sorcery-bugs AT lists.ibiblio.org

Subject: Bugs for Sorcery are reported here

List archive

Chronological Thread  
  • From: bugzilla-daemon AT bugs.sourcemage.org
  • To: sm-sorcery-bugs AT lists.ibiblio.org
  • Subject: [SM-Sorcery-Bugs] [Bug 13356] config_query gets slower as CONFIGURE progresses
  • Date: 1 Jan 2007 16:47:24 -0000

http://bugs.sourcemage.org/show_bug.cgi?id=13356





------- Additional Comments From jakakranjc AT email.si 2007-01-01 10:47 -------
The $@ isn't quoted in the original either, that's how they pass the first
test
- "" is dropped. This was one of the tests that my implementation was failing
(now it passes everything).

I don't know much about how [[ ]] matching works, so my attempt was in awk.
Thus that approach unintentionally preserves the regex search functionality.

function new2_list_find () {
local i
local input=" ${1:-qwertzuiop} "
shift

awk -F " " -v input="$input" '{
for(u=1; u<=NF; u++)
if(sub("[[:space:]]"$u"[[:space:]]","",input)) exit 222
}' <<< "$@"
[[ $? == 222 ]] && return 0
return 1
}

Some worst case/best case timings for the three functions; agregate of 200
runs:
one string lenght, one nonmatching search term
----------------------------
old function times:real 0m1.633s
new function times:real 0m0.048s
my function times:real 0m1.740s

10 string lenghts, one nonmatching search term
----------------------------
old function times:real 0m2.016s
new function times:real 0m0.257s
my function times:real 0m2.042s

100 string lenghts, one nonmatching search term
----------------------------
old function times:real 0m5.708s
new function times:real 0m2.229s
my function times:real 0m5.509s


one string lenght, five nonmatching search terms
----------------------------
old function times:real 0m8.221s
new function times:real 0m0.103s
my function times:real 0m1.775s


10 string lenghts, five nonmatching search terms
----------------------------
old function times:real 0m9.537s
new function times:real 0m0.602s
my function times:real 0m2.298s

100 string lenghts, five nonmatching search terms
----------------------------
old function times:real 0m22.597s
new function times:real 0m5.480s
my function times:real 0m7.567s

one string lenght, 50 nonmatching search terms
----------------------------
old function times:real 1m26.371s
new function times:real 0m0.762s
my function times:real 0m2.303s

So the [[ ]] is really fast, awk is pretty much the same as the old grep, but
shines in the bigger searches.

Casting net-tools now takes 16,5s (time cast net-tools\nnyyyn), the whole
protocol bunch just wheezing by, while the old system takes 62s (average of
three hot runs). It really is a major bottleneck!


--
Configure bugmail: http://bugs.sourcemage.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.




Archive powered by MHonArc 2.6.24.

Top of Page