View previous topic :: View next topic |
Author |
Message |
JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Thu Oct 16, 2008 11:01 pm Post subject: 32- versus 64-bit ints |
|
|
Out of curiosity I enabled 64-bit ints on my 32-bit machines and.. well, after throwing some microbenchmarks at it, it doesn't seem that much slower. There is a statistically significant slowdown of 5-10% by using 64-bit ints as opposed to 32-bit ones.
However, since 64-bit platforms are quickly becoming the rule rather than the exception, these differences will become nonexistent. 64-bit ints also don't incur a memory penalty, as MiniD uses 64-bit floats already. Because 64-bit ints have such an absurdly large range, it removes the need for arbitrary-precision integers in a large number of cases. 64-bit ints also allow access to some system apis (like high-precision timers and file sizes) that would otherwise be impossible to represent with 32-bit ints.
The reason I bring these points up, then, is that I'm considering abolishing 32-bit ints in MiniD 2, and using 64-bit ints exclusively. Allowing users to pick which int size to use seems like a tricky proposition, as code could (and would) be developed to depend upon ints being a certain size, making it harder to mix code from different authors. Having two int sizes effectively creates two nearly-identical but not-entirely-compatible languages.
(The last point could also be made about varying levels of coroutine support, but that is a slightly different issue as you'll get an error if code depends upon more support than you have enabled, whereas with ints, everything happens silently. Choice of int size is also much more subjective, whereas choice of coroutine support may be dictated by stringent memory constraints, for example.)
Long story short: would it be OK for MiniD 2 to use 64-bit ints only, or should support for choosing int size be retained? I'm currently leaning pretty strongly towards the former so you'll have to bring up some good points to convince me of the latter ![Wink](images/smiles/icon_wink.gif) |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
csauls
Joined: 27 Mar 2004 Posts: 278
|
Posted: Fri Oct 17, 2008 4:29 pm Post subject: |
|
|
I say go with 64bit ints. The penalty is increasingly small (moving, as you say, toward non-existant), and the benefits are manifest. _________________ Chris Nicholson-Sauls |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Jim Panic
Joined: 28 Nov 2004 Posts: 1 Location: Austria, Vienna
|
Posted: Sat Oct 18, 2008 8:46 am Post subject: |
|
|
Honestly: I wouldn’t even notice the difference. Go for it! |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Mon Oct 27, 2008 7:28 pm Post subject: |
|
|
Almost 100 views and no counters. OK, 64-bit ints it is. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Kosmonaut
Joined: 22 Jun 2008 Posts: 10
|
Posted: Fri Oct 31, 2008 12:27 am Post subject: |
|
|
64-bit integers PLZOKTHNKBYE |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|