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: 23 Dec 2006 22:43:40 -0000

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





------- Additional Comments From iuso AT sourcemage.org 2006-12-23 16:43 -------
I looked at the list_find in sorcery and can't help but wonder why it uses
grep when there are ways in bash to search for strings.

I took a minute to write a bash-only list_find and benchmark it against
sorcery's own. My tests showed the bash-only implementation to be about 30
times faster than the normal one (4096 times list_find for one word in a
10-word list: bash-only 0.7 secs, grep-based 21 secs).

Here it is:

function list_find()
{
local i
local input=" $1 "
shift
for i in $@
do
[[ "$input" == *\ $i\ * ]] && return 0
done
return 1
}

--
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