Vote to Remove Enum.IsDefined From All System.Drawing Members

Enum.IsDefined is an expensive call taking a significant amount of time, and boxing (allocating memory) on every call. There are numerous System.Drawing property setters that call Enum.IsDefined. Officially, Enum.IsDefined is recognized by MS as a problem and now its usage violates official .NET Framework Design Guidelines.

Speed up VG.net and other graphical applications, and reduce heap usage, by voting for this relatively minor change:

Remove Enum.IsDefined calls from all System.Drawing members

3 Comments

  • Hi. Great work so far.



    Have you though about wrapping the gdiplus dll, yourself. You could probably get better performance than they do, by removing any unncesseary error checking. Btw. I am in the planning stages of writing a specialized charting component. Do you think VG. Net is an option as the rendering engine for my charting component.

  • Hi Hart,



    Thanks! We did think about wrapping the GDI+ dll. You are right, we could get some perf gains that way. But then we have to use PInvoke, unsafe code, and our code would no longer run in a restricted security setting. Nor would it be portable to Mono. We are hoping to run on Mono as soon as the System.Drawing implementation is up to snuff.



    Should you use VG.net for your charting component? If it is animated, you may gain some speed that way. We optimize that stuff heavily. If you are drawing a strip-chart there is a particular optimization we do not do (the scrolling of the bits) that you would have to do yourself, so for that, I would say no.



    If your chart is not animated then it is just up to the ease of use of the API. If you find VG.net easier to use than GDI+, and you don't want to create your own retained mode system, go for VG.net. Of course we would do it that way, if we were to build one (we are not).

  • Hi no scrolling needed. So your component is still a strong contender. One thing I find missing in your product, is a roadmap; describing what your plans are. If the roadmap was accessable, I would thing it would be easier to justify the most expensive package (2000$).



    To see what I mean take a look at: http://projects.edgewall.com/trac/roadmap

Comments have been disabled for this content.