Groups | Blog | Home
all groups > dotnet faqs > october 2004 >

dotnet faqs : I need speed Mr .Net....speed


Cowboy (Gregory A. Beamer) - MVP
10/28/2004 6:33:04 AM
For pure performance, C++ will beat .NET languages in graphics (at least in
most cases). The major .NET benefits is the ability to get deep into the
WIndows API without API calls, the speed of development, etc.

This is not saying .NET is not fast. I have an file manipulation application
that achieves astounding speeds (rips through an 8GB file (76 columns fixed
width) in less than 20 minutes on 1.6 GHz P4 with 512MB RAM.

One issue with VB.NET is when you use the "Crutches" in the language. The
extra weight can kill your app if max perf is the issue.

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

[quoted text, click to view]
CJ Taylor
10/28/2004 7:49:14 AM
Try using DirectX. No need to learn C++ and performs a variety of 2D and 3D
functions for you [already written in C++]

[quoted text, click to view]

Ham
10/28/2004 3:36:36 PM
Yeah,
Gotto work with my VB.Net graphic application for days, do any possible type
of code optimization, check for unhandled errors and finally come up with
sth that can't process 2D graphics and photos at an acceptable speed. I have
heard things about the virtual machine of Mr. Net, that it can run my app at
a high speed....but could never compare it with Java VM and its speed. Then,
what should i do? Go and learn C++ ? Do i have time for it? Can't Microsoft
enhance its .Net VM to run VB.NET applications at a C++ program speed?
.....And how long should we wait for reaching the Native speed?....
(and why the same managed C++ application run faster? We need more liberty
guys..)

(using VB.NET 2003 + Framework 1.1)

i stay here....


Larry Serflaten
10/28/2004 9:06:18 PM

[quoted text, click to view]

Specifically relating to graphics;

A.
Dim bmp as Bitmap = New Bitmap(3000,5000)

vs

Dim bmp as Bitmap = New Bitmap(3000,5000, Me.CreateGraphics)


B.
frmGraphics.DrawImage(bmpSource, Dest, Src, GraphicsUnit.Pixel)

vs

frmGraphics.DrawImageUnscaled(bmpSource, 0, 0)


The second option in both A and B can significantly increase
performance in performance critical code. That is to say, there
are performant routines in the .Net framework, the trick is knowing
where they are, and how to put them to use...

Thomas Scheidegger [MVP]
10/29/2004 8:18:13 AM
[quoted text, click to view]


this has to be slow, by design...
And the speed is limited by GDI+, not by VB.NET or the CLR.

Try:
http://msdn.microsoft.com/library/en-us/dncscol/html/csharp11152001.asp


instead of 'unsafe' C#,
maybe you could use IntPtr and the Marshal.* class for VB.



--
Thomas Scheidegger - MVP .NET - 'NETMaster'
http://www.cetus-links.org/oo_dotnet.html - http://dnetmaster.net/

ham Come
10/29/2004 8:32:28 AM
Let me clarify it:
I work currently on a bitmap editor and want to edit images pixel by pixel.
I mean using " GetPixel(i,j) and SetPixel(i,j,color) "....
The application has to go through the whole pixels and do the operation by
using" For-Next" loops. It works fine on upto 1000 * 800 bitmaps, but on
higher
resolutions, event with a separate thread for this Sub, the result is really
frustrating. My P4 2.4 GHZ computer hangs and this some times takes a minute
for a simple operation.....

And for the guy who said to use DirectX ....
First of all, direct X does not give all the facilities of GDI+....
Second, I have a lot of limitations concerning the size of my App and its
distribution...
That's why I never go towards DX for those GDI+ operations...

Thanks...

[quoted text, click to view]


Antony Baula
10/29/2004 12:04:04 PM

Refer to http://msdn.microsoft.com/vcsharp/team/code/libraries/default.aspx
anf check out a #Randor library http://www.saintbox.net/

[quoted text, click to view]

AddThis Social Bookmark Button