detrino
Joined 13 years ago
Joined 13 years ago
When using Windows or Linux I don't find much benefit in text rendering on a 4k display.
But as Mac OS X has no sub pixel rendering or grid fitting text looks terrible without a high ppi display.
Does it require constant time concat?
Does it require immutability?
Does it require a balancing scheme based on the fib sequence?
Does it require that the tree is binary?
My tree is an attempt to be as fast as possible with log everything operations and no pointer/reference stability.
Basically, it has O(log n) everything like a binary search tree you suggested but also very good constant factors.
By default, leaves hold 1024/sizeof(T) elements and branches hold 47 elements, so it can access up to 13,289,344 8 byte elements with only 4 levels.
Note that the assembly for process_message2 calls each function only once even though some appear twice in the body.
Consider this example: http://ideone.com/T872Oj
In F1 the compiler can NRVO away the move.
In F2 it cannot.
Both will fail to compile if you delete the move constructor.
void TestSigned(int min, int max, int step) {
for (int i = max; i >= min; i -= step) F(i);
}
Becomes this with unsigned: void TestUnsigned(unsigned min, unsigned max, unsigned step) {
while (true) {
F(max);
if (max < min + step) break;
max -= step;
}
}
Now if I want to transform my loop to operate on pointers or iterators, the transformation is trivial: void TestUnsigned(unsigned *min, unsigned *max, unsigned step) {
while (true) {
F(*max);
if (max < min + step) break;
max -= step;
}
}
Quick: Do the same for yours.