CodeDom Tip: Cache Reusable Objects

2006-10-26
1 min read

Because CodeDom is so verbose and uses a massive grid of objects to represent code structures, it also has many small reusable objects, such as CodeTypeReference objects. Many people overlook this fact because there are so many object being created anyway, but sometimes a certain object will be used over and over. Since both the creation of these objects takes time and they also take up memory as unnecessary copies, consider creating a cache….

You can read the copy of the original post, or if that goes down too, you can try the Wayback Machine’s copy of it.

Context: This post was automatically imported from my old blog, which was originally hosted on Microsoft’s ASP.NET Community Blogs. When they shut it down, I dumped all of my old posts to Wordpress. You can still check out the original blog on the Wayback Machine.