performance improvement on plain string edge matching