Wednesday, January 20, 2021

Digest for comp.lang.c++@googlegroups.com - 5 updates in 3 topics

"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jan 19 06:26PM -0800

On 1/18/2021 11:20 AM, Bonita Montero wrote:
>>> C++17 honors alignas.
 
>> Ohhh. Nice! I need to give it a go. Thanks.
 
> Which compiler did you use to test the code I did give ?
 
What compiler did you use for it?
Bonita Montero <Bonita.Montero@gmail.com>: Jan 20 07:37AM +0100


>>> Ohhh. Nice! I need to give it a go. Thanks.
 
>> Which compiler did you use to test the code I did give ?
 
> What compiler did you use for it?
 
MSVC2019 under Win10 and gcc under WSL/Win10.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jan 20 01:25PM -0800

On 1/19/2021 10:37 PM, Bonita Montero wrote:
 
>>> Which compiler did you use to test the code I did give ?
 
>> What compiler did you use for it?
 
> MSVC2019 under Win10 and gcc under WSL/Win10.
 
I have been meaning to install MSVC 2019 for a while now. Never got
around to it. So, I am assuming your code works under it right? Where
the output is _not_:
 
doesn't fit
 
right?
 
Also, can you pretty please try to quote properly? Its hard to follow
the chain in the thread.
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jan 20 01:21PM -0800

On 1/8/2021 5:49 PM, Chris M. Thomasson wrote:
> compiler of choice? Does it produce the ppm; can you view it? How many
> warnings do you get?
 
> Any advise?
[...]
 
An easier way to get the code:
 
https://pastebin.com/raw/txz3pQ2Y
Juha Nieminen <nospam@thanks.invalid>: Jan 20 08:50PM

> Unfortunately the code needs severely degenerated input to compete
> with std::sort.
 
It's hard to compete with introsort for the vast majority of input.
The insertion sort that it uses for small-enough partitions speeds it
up by quite a margin.
 
To make merge sort competitive you need to do the same, in other words,
use insertion sort for small-enough segments.
 
If you are using the recursive form of merge sort, if the segment to
sort is small enough, just use insertion sort instead of calling the
merge sort recursively for its two halves.
 
If you are using the iterative form of merge sort (ie. you start with
segments of 2 elements, then go up from there) you need to do the
insertion-sorting first for segments of the array of a smallish
size, and then run merge sort starting with that size.
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: