FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

32- versus 64-bit ints

 
Post new topic   Reply to topic     Forum Index -> MiniD
View previous topic :: View next topic  
Author Message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Thu Oct 16, 2008 11:01 pm    Post subject: 32- versus 64-bit ints Reply with quote

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
Back to top
View user's profile Send private message
csauls



Joined: 27 Mar 2004
Posts: 278

PostPosted: Fri Oct 17, 2008 4:29 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger
Jim Panic



Joined: 28 Nov 2004
Posts: 1
Location: Austria, Vienna

PostPosted: Sat Oct 18, 2008 8:46 am    Post subject: Reply with quote

Honestly: I wouldn’t even notice the difference. Go for it!
Back to top
View user's profile Send private message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Mon Oct 27, 2008 7:28 pm    Post subject: Reply with quote

Almost 100 views and no counters. OK, 64-bit ints it is.
Back to top
View user's profile Send private message
Kosmonaut



Joined: 22 Jun 2008
Posts: 10

PostPosted: Fri Oct 31, 2008 12:27 am    Post subject: Reply with quote

64-bit integers PLZOKTHNKBYE
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MiniD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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