News for hackers. Stuff that matters.
Re:Three Optimization Tips for C++ by eco on Wednesday May 07, 2014 @05:05PM (#7712649)
Pointers would be an exception, of course. As others wrote he's talking about general data. Just because 64-bit ints are faster on 64-bit processors than on 32-bit processors doesn't mean you should use them when a 32-bit int would suffice.
Re:Three Optimization Tips for C++ by protopete on Wednesday May 07, 2014 @05:30PM (#7712764)
Pointers don't have to be the exception. I'm working on a programming language runtime where objects are stored as a 32-bit value, with 3/4 of the range representing an integer, and 1/4 of the range (30 bits) representing a pointer. Given the constraint that pointer objects are aligned to 8 bytes, the 30-bits multiplied by 8 results in an 8GB addressable memory space. Pages within that space can be allocated using mmap with MAP_FIXED flag. Smaller memory usage results in more things in cache, resulting in higher performance.
Re:Three Optimization Tips for C++ by TorKlingberg on Wednesday May 07, 2014 @06:09PM (#7712909)
So, your pointers will not be able to address bytes individually? No char pointers, or is it 8 byte chars? Or is this a completely different language without raw pointers?
Re:Three Optimization Tips for C++ by protopete on Wednesday May 07, 2014 @06:47PM (#7713053)
The language is currently without raw pointers, suitable for an object system like Python/Ruby/JS.
Re:Three Optimization Tips for C++ by TillE on Wednesday May 07, 2014 @05:20PM (#7712719)
Oh. That's sort of blindingly obvious, but fair enough.