Programming Microsoft® Composite UI Application Block and Smart Client Software Factory
by David S. Platt
Appendix A Lab Exercises Generics
Open the solution in the folder \Generics\Lab\Template, from the Appendix A sample code from the book's Web site. Build it and run it just to make sure that nothing silly is broken.
The program performs a performance test with both a value type and a reference type. The template already does this with a nongeneric stack. Add code that performs the same test with a generic stack. Observe the performance difference with both value and reference types.
The results of that test may not be exactly as you expect. Dig into the System.Dll using ILDASM and try to figure out why.
Run the performance test again with larger value types and see what sorts of numbers you get. Try creating your own extra-large value type, perhaps ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access