Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Came across something interesting...
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

cbx
Swordmaster

Canada
296 Posts

Posted - Jun 18 2005 :  03:01:41 AM  Show Profile  Visit cbx's Homepage  Send cbx an ICQ Message  Click to see cbx's MSN Messenger address  Send cbx a Yahoo! Message  Reply with Quote
Now that I am using two computers (laptop and desktop) I find myself needing to sync files between both computers. So I was using VBExpress beta2 to create a file sync utility for my self when I stumbled across this little tidbit under the Widbey documentation.

quote:
Most Efficient Data Types
For variables that never contain fractions, the integral data types are more efficient than the nonintegral types. In Visual Basic, Integer and UInteger are the most efficient numeric types.

For fractional numbers, Double is the most efficient data type, because the processors on current platforms perform floating-point operations in double precision. However, operations with Double are not as fast as with the integral types such as Integer.


This is interesting to me because I am a directx programmer and as any managed directx programmer knows is that all the data types and classes etc in the managed directx sdk use the Single data type, not the Double data type!!! Maybe someone should contact Tom miller about this??

Here is the link to the documentation...

http://whidbey.msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vbalr/html/28f5e4ba-ec24-4f37-b90a-e8ee822f778a.asp

Created by: X
http://www.createdbyx.com/

Edited by - cbx on Jun 18 2005 03:03:51 AM

Eric Coleman
Gladiator

USA
811 Posts

Posted - Jun 18 2005 :  11:51:33 AM  Show Profile  Visit Eric Coleman's Homepage  Reply with Quote
It doesn't make any sense that a Double data type would be faster than Single. A speed test between single and double data types might be interesting to see.

Go to Top of Page

cbx
Swordmaster

Canada
296 Posts

Posted - Jun 18 2005 :  5:44:25 PM  Show Profile  Visit cbx's Homepage  Send cbx an ICQ Message  Click to see cbx's MSN Messenger address  Send cbx a Yahoo! Message  Reply with Quote

I have written a speed test app but I don't think it works. It seems ot do wierd things like not adding two integers together. For example the total time it took to process the loop is stored in an array. The test runs the loop 5 times so the array contains 5 numbers. The app is then suppoed to add all the numbers in the array to get the total time it took to run the test. If you run the test repeatedly say 5 times you should see what I mean. Sometimes the numbers are added together as expected and sometimes there not. Strange.

Another minimal test all I made that I know does work puts the single data type as being faster then the double data type most of the time. I say most of the time because sometimes it returns the oposite.

The code and executable is provided in any case...

VB.NET 2002 .net 1.0
Download Attachment: SingleDoubleSpeedTest.zip
8.69 KB

Created by: X
http://www.createdbyx.com/
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
VBGamer © Go To Top Of Page
This page was generated in 0.11 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.