newCTFE is getting ported to 2.092
Stefan Koch
uplink.coder at googlemail.com
Sat Jun 6 22:43:03 UTC 2020
On Friday, 5 June 2020 at 21:52:05 UTC, Steven Schveighoffer
wrote:
> On 6/5/20 5:46 PM, Stefan Koch wrote:
>> On Friday, 5 June 2020 at 21:09:37 UTC, H. S. Teoh wrote:
>>> On Fri, Jun 05, 2020 at 08:24:10PM +0000, Stefan Koch via
>>> Digitalmars-d wrote:
>>>> newCTFE port to 2.092
>>>
>>> How close are we to newCTFE being mergeable? Been slobbering
>>> over it since it was first announced way back when, can't
>>> wait for it to arrive already!
>>>
>> Trust me once it's merged you'll be disappointed because the
>> problem were templates all along (hence my work on type
>> functions)
>
> But without newCTFE the cure is worse than the disease.
>
> I think it's going to allow more possibilities of replacing
> templates with CTFE handling.
>
> I have some ideas to do type functions without specialized
> compiler support. But I think it would be painful without a
> better CTFE engine.
>
> -Steve
I have a meaningless performance number for you.
for this code:
uint f(uint x)
{
uint acc;
foreach(i; 0 .. x) acc += x;
return acc;
}
pragma(msg, f(ushort.max * 2));
oldCtfeTime: 150 milliseconds.
newCtfeTime: 12 milliseconds.
around a 12x speedup for simple stuff like this.
For more complicated cases the numbers are going to be more
varied.
More information about the Digitalmars-d
mailing list