Make shared static this() encoding table compilable

zhad3 no at spam.pls
Wed Mar 16 18:22:32 UTC 2022


On Monday, 14 March 2022 at 19:05:41 UTC, Ali Çehreli wrote:
>
> Yes, better but not much: 37 seconds vs. 50+ seconds on my 
> system.
>
> Even though I am pretty sure the OP has access to the keys and 
> the values separately, if it helps, I used the following code 
> to separate the keys and values:
>
> [snip]
>
> shared static this() {
>   cp949_table = make_cp949_table();
> }
>
> Yeah, dmd's -O performance with those tables is still very poor.
>
> Ali

Thank you for this. This works although I could not reach the 
same speed as you. I wonder if people with less memory as me (16 
GB) will still be able to compile it.

DMD (DMD64 D Compiler v2.098.1)
```
$ time dub test --compiler=dmd --build=release

real	2m11,438s
user	2m11,134s
sys	0m0,153s
```
LDC (LDC - the LLVM D compiler (1.26.0): based on DMD v2.096.1 
and LLVM 7.0.1)
```
$ time dub test --compiler=ldc2 --build=release

real	0m18,466s
user	0m18,099s
sys	0m0,151s
```

But this is definitely better than failing with an error. I have 
not yet tried the -lowmem flag. I'll try that later.
I think I'll use your solution for now as that works and 
hopefully people won't have to recompile everything so often. 
Usually this should just get compiled once and be good with it :)


More information about the Digitalmars-d-learn mailing list