Would redrawing controls in c# give more performance?

Now I realize this is a kind of weird question but here it is:
Let us assume I redraw all the controls by myself rather than using the default provided ones (Obviously I’m talking of winforms as WPF is already a custom drawn control set and winforms are just a way to access the Win32 API). Now I make an application with my custom-drawn controls. Then I make an application with winforms, which, in turn, uses the Win32 API. Now, when I run both the applications, will there be any performance difference? If yes, which will perform better?

Now comes the main question:
How (and based on what factor(s)) do you decide / predict as to which will perform better?

P.S. Forgive me if I am not clear enough. I always have trouble expressing my thoughts.

Remember that .NET Framework BCL code is optimized for being useful to the largest number of programmers, not for good performance in your particular application. So it’s highly likely that you can beat the performance of any particular piece of it, even if you aren’t a Rico Mariani.

However, you should learn from those experts, in particular mantras like “Measure, Measure, Measure”. This doesn’t mean you have to build and debug your version completely before figuring out whether you can beat the BCL. It does mean you identify which portions of the library code are causing you performance issues, so you don’t waste effort re-inventing what doesn’t matter.

Once you know how good or bad the performance of the general-purpose code is, you stand a good chance of predicting whether you’ll be able to beat it. Especially if you run some scalability tests. There are lots of framework-provided widgets where simple operations like adding multiple listbox items1 have quadratic (or worse) complexity… simply because the largest number of applications never put more than two dozen items in the control anyway. Armed with an estimate of the standard widget’s runtime (and memory) complexity for the operations you need, you’ll know exactly where you have the opportunity to do better in a way that pays dividends on your effort.


1 Sometimes the documentation points these out and even provides a way to plug in optimized-for-the-application code without throwing away the whole library component. For example, ListView “virtual mode”, or “Owner-Draw” for the tradition Win32 controls.

2

You don’t “decide/predict” those things. Similarly, you don’t predict where a bottleneck is.

If you need to know which solution is faster, you do both, and then compare the benchmarking results.

You understand that the result will depend, among others, on how good your optimization skills are compared to the skills of Microsoft developers, and we can’t possibly know how good you are, right?

There are many parameters involved in performance: your profiling/optimization skills, but also purely technical ones, like the number of layers of abstraction. You may obtain excellent performance results for a home-made solution made during a weekend. Or you may spend months profiling and optimizing your app and still be behind .NET Framework’s performance. Unless you actually do the test, you can’t know the answer.

3

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật