Alphapedia, our wiki-based, context-sensitive help system.
Confused as to why this particular function was never documented before, I enlisted Clifton to sniff out who was responsible. His nose led me straight to Dr. Martin Heller who was able to provide a detailed explanation: Oops, we forgot. For that oversight he'll have to share part of his lunch with Clifton from now on. ;)
Now, let me tell you what you've been missing. The compilestringtemplate() function can double, triple, or quadruple the performance of your Web application, depending upon the complexity of the template. Now, if you're using the standard Ajax Grids, then this won't help you because the function has been used internally since it was written.
This function helps developers who are generating their own HTML programmatically. That's because they usually want a lean, mean, and speedy display and don't need all the editing features of the Grid. Developers coding their Web applications by hand sometimes create a database query and then generate some HTML content to send to the browser. The HTML content is often generated by merging data from the database into an HTML template. The evaluate_string() function is used because it's ideal for merging data into a template.
However, in a case where the HTML content is constructed by looping over the records in the query and merging data into the template for each row in the query, using the compilestringtemplate() function can be more efficient. With it, you can compile the merge code once and then run it against multiple data rows. And the more complex the template, and the more iterations there are, you could easily see an improvement of 100 to 200 percent.
I'm not going to repeat what's in Alphapedia, so head over to the entry for a full description. Then give it a try yourself and let me know what you think.