News for hackers. Stuff that matters.
Re:Engineering Faster Sorters for Small Sets of Items by renox on Friday February 14, 2020 @04:48PM (#22330740)
In the similar topic, I'm trying to find maps optimised for a small maximum number of items (8 or 16) indexed by integers. Curiously I failed to find discussions about this topic.. But std::map seems very badly fit for this kind of map.
Re:Engineering Faster Sorters for Small Sets of Items by matt_d on Friday February 14, 2020 @06:27PM (#22331474)
Re:Engineering Faster Sorters for Small Sets of Items by renox on Saturday February 15, 2020 @02:13AM (#22333859)
Thanks but these structures are size optimised, I'm looking for CPU usage optimised structures.
Re:Engineering Faster Sorters for Small Sets of Items by jdoerfert on Saturday February 15, 2020 @04:20AM (#22334196)
Re:Engineering Faster Sorters for Small Sets of Items by renox on Sunday February 16, 2020 @01:38AM (#22340173)
I will have a look thanks. I think I'll implement it with two arrays one for keys one for values and a loop to find the key index, then return the corresponding value It may be better to fully unroll the loop, I'll have to benchmark this. SSE may be interesting too.
Re:Engineering Faster Sorters for Small Sets of Items by thedance on Friday February 14, 2020 @01:14AM (#22324344)
The most interesting thing to me is "the compiler reduces its optimizations with increasing compilation effort, when compiling only a single source file." Is this GCC-specific, or does it also hold for clang? And can it be tuned away?
Re:Engineering Faster Sorters for Small Sets of Items by jdoerfert on Friday February 14, 2020 @02:42AM (#22324729)
Clang will not "reduce compilation effort" and I do not believe GCC does that. There are heuristics that look at things like function size but I don't think that is what they mean. Generally speaking, translation units are independent if you do not run link-time-optimizations (LTO) and optimizations follow a (basically) predetermined order which might be influence by the input but not by the amount of work done.
Re:Engineering Faster Sorters for Small Sets of Items by thedance on Friday February 14, 2020 @11:40AM (#22327944)
I’ve never heard of or experienced gcc using some kind of cost model for compilation time, either. With all these huge protobuf-generated files you’d think I would have noticed if it existed.
Re:Engineering Faster Sorters for Small Sets of Items by Upvoter33 on Thursday February 13, 2020 @10:34PM (#22323775)
Love papers like this, hyper-focused on a fun problem and then full of hacks.