Performance impact: Speeding up SMO script generation – the test code

The attached is the C# code that I used for generating the test results charted in my previous post.

Note that for testing no generated script is actually persisted into a file by this program. The Script() method is applied, but the resulting script strings are thrown away. For example, here is how a stored procedure is scripted: