Thread: which is faster? DWORD or WORD?

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    142

    Wink which is faster? DWORD or WORD?

    well, you see, intel processors access datas in the memory in 32 bit size, so, if i use WORD which is an 8 bit, would it slow it down? or is it faster?

    because if it doesn't have any effect, then i would be able to save a little bit of memory by using WORD instead of DWORD if i don't need those very large value,

    many thanks!

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Slow down there buddy. Here is the deal. First off a DWORD is an unsigned long (32-bit) and a WORD is an unsigned short (16-bit). Read this carefully so you don't get lost. Your processor is probably a 32-bit processor. For your 32-processor, you can attain maximum speed if you were to make all of your calls to the processor with 32-bit data streams. However, when you need to make operations (such as multipication and division) on a 32-bit number your processor (and/or math co-processor) is going to have to maintain larger numbers. A WORD times a WORD will be less expensive than a DWORD times a WORD. Also, on a side note.

  3. #3
    Registered User
    Join Date
    Apr 2002
    Posts
    142
    thanks!,

    is there any other things that i should know?

    how about you, are you going to store everything in DWORD if you're not going to make any mul/div on them?

  4. #4
    Registered User
    Join Date
    Dec 2001
    Posts
    70
    Sole DWORDs would be useful only in time crucial operations. I use words and bytes extensively and do not care about speed when I do not need it.

  5. #5
    Unregistered
    Guest
    Originally posted by master5001
    [B]Read this carefully so you don't get lost
    Read this carefully so you don't get lost. 16-bit prefix.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 11-23-2007, 01:48 PM
  2. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  3. if is faster than switch?
    By skorman00 in forum C++ Programming
    Replies: 32
    Last Post: 03-06-2004, 01:15 PM
  4. storage size of regs is unkown
    By Vertex34 in forum C Programming
    Replies: 5
    Last Post: 11-04-2003, 10:17 AM