Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Programming IT Technology

What's Faster: Hex Math or Int Math? 11

Morbaal writes "I am working on a project where we have to have a minimal ammount of load on the db server. So my question is should I submit hex data for the server to compute or int data or does it matter at all?" Clearly this depends on which version of SQL Server you're using.
This discussion has been archived. No new comments can be posted.

What's Faster? Hex Math or Int Math??

Comments Filter:
  • If you use Intercal [tuxedo.org], all this discussion of number bases will be irrelevant. Assuming, of course, that you know Georgian and Roman Numerals.
  • His alter ego, Mr Jekyl, however, is just no fun at all.
  • Binary.

    But my guess is that it's not the math that's causing the load on your database server. Try moving the, er, adult website to a different machine than the database server.

  • but my dick is harder than Chinese math!

  • Did I actually post that?
    I've gotta lay off the whisky.
  • Well... I know I'm a bit of a "fool" for replying to an april fool's day posting, especially after the day has ended, but I suppose that if "decimal" were taken to mean "binary-coded decimal" and "hex" as just being the binary representation of the number, then hex would obviously be faster. Many CPUs still support BCD operations directly (for legacy support), but they're hardly optimized for that. So yeah, hex will be much faster than decimal!
  • by MrHat ( 102062 ) on Sunday April 01, 2001 @05:19PM (#321858)
    So my question is should I submit hex data for the server to compute or int data?

    Actually, if you compress it first with lzip, you'll generate a lot less network traffic, and thus less server load.

    Sheesh... As more and more of these things get posted, I'm starting to gain an appreciation for the heaps of shit that the slashdot editors wade through.


    43rd Law of Computing: Anything that can go wr
  • Remeber: It's not too important if it's base 10 or base 16. What's important is to who do all the base are belong to.

    (Geez, I can no longer tell if this are actual "Ask Slashdot" submissions, or if they're ALL April Fool's)

    Tongue-tied and twisted, just an earth-bound misfit, I
  • because ALL your base belong to us!
  • I'm not sure what you mean by "submit". If you are using SQL, all data is strings, so the strings are parsed into binary. I cannot believe that parsing hex is any faster than parsing decimal, There may be a spare clock cycle or so at most due to the base 16 being a nice power of two.

    If you are CODING the database server and talking about data in the code, during compiling it's translated to binary. so it doesn't really matter there either. In the end, it's all 1s and 0s. The only place it could be considered faster to use Hex is if you are doing translations from int to string. In this case, going from binary to hex is faster than binary to decimal (due to the base 16 again) but remember, only by a clock cycle or two.

    Hope that helped.
    --
    He had come like a thief in the night,
  • Your question is like asking whether having 8 fingers at each hand will make you count faster. I guess not, but it sure makes cleaning your ears more handy.
    -----

Understanding is always the understanding of a smaller problem in relation to a bigger problem. -- P.D. Ouspensky

Working...