Skip to content

Commit

Permalink
Found performance problem. Setting a really big Match_Distance *really*
Browse files Browse the repository at this point in the history
slows things down.
  • Loading branch information
KyleAMathews committed Dec 2, 2011
1 parent 873ba2a commit f2d050d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fuzzymatcher.js
Expand Up @@ -51,7 +51,7 @@
// How far to search for a match (0 = exact location, 1000+ = broad match).
// A match this many characters away from the expected location will add
// 1.0 to the score (0.0 is a perfect match).
this.Match_Distance = 100;
this.Match_Distance = 10;

// The number of bits in an int.
this.Match_MaxBits = 32;
Expand Down Expand Up @@ -352,7 +352,8 @@
}
// No need to keep searching beyond 100 results. In an
// autocomplete widget, the results are just an aid as people
// narrow down on a target.
// narrow down on a target so don't need to do an excaustive
// search.
if (num_matchs > 100) { break; }
}
matches.sort(function (a,b) { return a.match_score - b.match_score; } );
Expand Down

0 comments on commit f2d050d

Please sign in to comment.