473,473 Members | 1,489 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Is C# Slow?

I have a creeping suspicion that, no matter how well organized my code is
and no matter how smart I Invalidate( ) only part of the screen, the
graphics under C# is s-l-o-w.

Is that an issue?
Apr 19 '06 #1
9 5981
Hi,

What are you doing?
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Martijn Mulder" <i@m> wrote in message
news:44***********************@news.wanadoo.nl...
I have a creeping suspicion that, no matter how well organized my code is
and no matter how smart I Invalidate( ) only part of the screen, the
graphics under C# is s-l-o-w.

Is that an issue?

Apr 19 '06 #2
>>I have a creeping suspicion that, no matter how well organized my code is
and no matter how smart I Invalidate( ) only part of the screen, the
graphics under C# is s-l-o-w.

Is that an issue?

What are you doing?


I am 'tiling' the screen with many small pieces + animation
Apr 19 '06 #3
"Martijn Mulder" <i@m> wrote:
I have a creeping suspicion that, no matter how well organized my code is
and no matter how smart I Invalidate( ) only part of the screen, the
graphics under C# is s-l-o-w.


In my experience, the bulk of graphics time is taken up by the
operating system drawing calls (for drawing text, lines, polygons...).
The language you use to invoke them could be ten times slower without
impact. Even in DirectDraw/Direct3d, the bulk of the graphics time is
taken up by the cost of BitBlt or texture rendering in hardware, and
the cost of your own code is insignificant.

--
Lucian
Apr 19 '06 #4
Blitting under GDI+ does not take advantage of hardware accelleration.

A touch of interop to the BitBlit or StretchBlit API will help. Using
DirextX via the DX9.x .NET wrappers will speed it up enormously.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Martijn Mulder" <i@m> wrote in message
news:44***********************@news.wanadoo.nl...
I have a creeping suspicion that, no matter how well organized my code is
and no matter how smart I Invalidate( ) only part of the screen, the
graphics under C# is s-l-o-w.

Is that an issue?


What are you doing?


I am 'tiling' the screen with many small pieces + animation

Apr 19 '06 #5
I have 10,000 rectangles in a window and it updates about 50
times/second without flickering.

I use these commands:
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPointingInWmPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);

as well as using GDI+ to draw my rectangles.

Martijn Mulder wrote:
I have a creeping suspicion that, no matter how well organized my code is
and no matter how smart I Invalidate( ) only part of the screen, the
graphics under C# is s-l-o-w.

Is that an issue?


What are you doing?


I am 'tiling' the screen with many small pieces + animation


Apr 19 '06 #6
Is there hope that you will write and publish an article on DirectX in a
managed application?

(Btw, the link on page http://www.bobpowell.net/why_so_slow.htm to
directx.asp is no longer valid)

"Bob Powell [MVP]" <bob@_spamkiller_.bobpowell.net> schreef in bericht
news:e3**************@TK2MSFTNGP05.phx.gbl...
Blitting under GDI+ does not take advantage of hardware accelleration.

A touch of interop to the BitBlit or StretchBlit API will help. Using
DirextX via the DX9.x .NET wrappers will speed it up enormously.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Martijn Mulder" <i@m> wrote in message
news:44***********************@news.wanadoo.nl...
I have a creeping suspicion that, no matter how well organized my code
is and no matter how smart I Invalidate( ) only part of the screen, the
graphics under C# is s-l-o-w.

Is that an issue?


What are you doing?


I am 'tiling' the screen with many small pieces + animation


Apr 19 '06 #7
I might publish one of my existing articles on DirectX on my site.

Subscribe to the RSS feeds.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Martijn Mulder" <i@m> wrote in message
news:44**********************@news.wanadoo.nl...
Is there hope that you will write and publish an article on DirectX in a
managed application?

(Btw, the link on page http://www.bobpowell.net/why_so_slow.htm to
directx.asp is no longer valid)

"Bob Powell [MVP]" <bob@_spamkiller_.bobpowell.net> schreef in bericht
news:e3**************@TK2MSFTNGP05.phx.gbl...
Blitting under GDI+ does not take advantage of hardware accelleration.

A touch of interop to the BitBlit or StretchBlit API will help. Using
DirextX via the DX9.x .NET wrappers will speed it up enormously.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Martijn Mulder" <i@m> wrote in message
news:44***********************@news.wanadoo.nl...
>I have a creeping suspicion that, no matter how well organized my code
>is and no matter how smart I Invalidate( ) only part of the screen, the
>graphics under C# is s-l-o-w.
>
> Is that an issue?
What are you doing?

I am 'tiling' the screen with many small pieces + animation



Apr 20 '06 #8
Are you perchance using a Matrox graphics card? They are AFAIK the only ones
that support hardware accelleration for GDI+ and unless you have a really
kick-ass system I would be sceptical at those kinds of frame rates from
GDI+.

It might run like a dream on your machine but probably not on the standard
HP supermarket PC which is quite capable of running stuff like half-life or
flight-sim at excellent frame rates.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

<sh******@cs.fsu.edu> wrote in message
news:11**********************@z34g2000cwc.googlegr oups.com...
I have 10,000 rectangles in a window and it updates about 50
times/second without flickering.

I use these commands:
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPointingInWmPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);

as well as using GDI+ to draw my rectangles.

Martijn Mulder wrote:
>>I have a creeping suspicion that, no matter how well organized my code
>>is
>>and no matter how smart I Invalidate( ) only part of the screen, the
>>graphics under C# is s-l-o-w.
>>
>> Is that an issue?


> What are you doing?


I am 'tiling' the screen with many small pieces + animation

Apr 20 '06 #9
It's running gforce 5700 le I think and has a 1.2 GHz AMD Athlon
processor.

Apr 22 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: yawnmoth | last post by:
using the gethostbyname function seems to noticeably slow down pages. some of the comments in php.net's gethostbyname entry suggest using a version that caches the result, but those versions also...
8
by: Neil | last post by:
I have a very puzzling situation with a database. It's an Access 2000 mdb with a SQL 7 back end, with forms bound using ODBC linked tables. At our remote location (accessed via a T1 line) the time...
2
by: David | last post by:
Hi, We have an internal network of 3 users. Myself & one other currently have individual copies of the front-end MS Access forms and via our individual ODBC links we have used the: File > Get...
3
by: Jennyfer J Barco | last post by:
In my application I have a datagrid. The code calls a Stored procedure and brings like 200 records. I created a dataset and then a dataview to bind the results of the query to my grid using ...
50
by: diffuser78 | last post by:
I have just started to learn python. Some said that its slow. Can somebody pin point the issue. Thans
0
by: Pratchaya | last post by:
In my.cnf i add these lines ####### log-bin log-slow-queries = /var/log/mysqld-slow.log long_query_time=1 #######
2
by: mezise | last post by:
Posted by Pratchaya: ------------------------------------------------------ MySQL Slow Log ERROR In my.cnf i add these lines ####### log-bin log-slow-queries = /var/log/mysqld-slow.log
13
by: eighthman11 | last post by:
using Access 2003 and sql server version 8.0 Hey everyone. Created a text box where the user types in an Inventory number and it takes them to that inventory number on the contimuous form. The...
3
by: John | last post by:
Hi I have replaced an ms access app with its vb.net version at a client site. Now the clients keeps complaining about how slow the app response is. The complains they have are for example when...
10
by: penworthamnaynesh | last post by:
Does php slow your website down? This is what i would like to know.The reason is because my site is writtent 50% in html and 50% in php and is very slow at loading. And i cant tell wether php is...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.