title: Fast algorithm to find keywords in an HTML page using Javascript
body: <p>I have a JS specialty dictionary that find certain keywords on a page and add explanatory tooltips to them. Right now I'm using RegEx to find the keywords, but I suspect it will get slow very soon, when my dictionary grows bigger. I store dictionary entries in an array so I think that can be improved as well. My site language is Vietnamese and my keywords will all be English.</p>
  
  <p>Any idea on improving performance will be much appreciated. Thanks.</p>