Significant speedup of structure matcher.