Walter Bright schrieb:
Sönke Ludwig wrote:
In my project compilation takes now several minutes for some files which compiled in about a second with 2.021. I stopped the compilation of the whole project after about 2 hours (took 2 min at most on 2.021).

I'll try to track this down when I get the time, but i doubt that those times get anywhere near those of the original.

Do you have modules that recursively import themselves, and instantiate a lot of templates?

There were some import cycles and I've had some time now to remove all of them. There might be a small improvement but it feels just as slow as before (still multiple minutes for some files).

In the particular region of the library there is a Variant template in use at two places as a typedef: "typedef Variant!(TypeEnum, type1, type2, ..., type8);". This would be my main suspect when it comes to templates. However, compiling the Variant module alone or a small module only using Variant takes a fraction of a second.

I have attached the output of a CodeAnalyst profiling run. The file shows the hotspot section during the first 60 seconds of compiling one of the files. Percentages have to be multiplied roughly by 2 because this is a dual core system.
Address,Code Bytes,Instruction,Symbol,Total %,Timer samples,
"0x453cf8","0x 8B 0D D8 1A 51 00 ","mov ecx,[00511ad8h]","","0","0",
"0x453cfe","0x C1 E1 02 ","shl ecx,02h","","0","0",
"0x453d01","0x 51 ","push ecx","","0","0",
"0x453d02","0x 8D 4D F4 ","lea ecx,[ebp-0ch]","","0","0",
"0x453d05","0x E8 BA E9 07 00 ","call $+0007e9bfh (0x4d26c4)","","0","0",
"0x453d0a","0x 83 C4 04 ","add esp,04h","","0","0",
"0x453d0d","0x 89 C3 ","mov ebx,eax","","0","0",
"0x453d0f","0x 85 C0 ","test eax,eax","","0","0",
"0x453d11","0x 75 14 ","jnz $+16h (0x453d27)","","0","0",
"0x453d13","0x 68 6C 03 00 00 ","push dword 0000036ch","","0","0",
"0x453d18","0x 68 78 5C 4F 00 ","push dword 004f5c78h","","0","0",
"0x453d1d","0x 68 EC 5C 4F 00 ","push dword 004f5cech","","0","0",
"0x453d22","0x E8 C5 D2 07 00 ","call $+0007d2cah (0x4d0fec)","","0","0",
"0x453d27","0x 8B D7 ","mov edx,edi","","0","0",
"0x453d29","0x C1 E2 02 ","shl edx,02h","","0","0",
"0x453d2c","0x 52 ","push edx","","0","0",
"0x453d2d","0x 89 5D F8 ","mov [ebp-08h],ebx","","0","0",
"0x453d30","0x FF 35 E0 1A 51 00 ","push dword [00511ae0h]","","0","0",
"0x453d36","0x FF 75 F8 ","push dword [ebp-08h]","","0","0",
"0x453d39","0x E8 22 D1 07 00 ","call $+0007d127h (0x4d0e60)","","0","0",
"0x453d3e","0x B9 D4 1A 51 00 ","mov ecx,00511ad4h","","0","0",
"0x453d43","0x 6A 00 ","push byte 00h","","0","0",
"0x453d45","0x E8 4A A4 07 00 ","call $+0007a44fh (0x4ce194)","","0","0",
"0x453d4a","0x 31 DB ","xor ebx,ebx","","0","0",
"0x453d4c","0x 83 C4 0C ","add esp,0ch","","0","0",
"0x453d4f","0x 85 FF ","test edi,edi","","0","0",
"0x453d51","0x 74 14 ","jz $+16h (0x453d67)","","0","0",
"0x453d53","0x 6A 00 ","push byte 00h","","0","0",
"0x453d55","0x 8B 55 F8 ","mov edx,[ebp-08h]","","0","0",
"0x453d58","0x 8B 34 9A ","mov esi,[edx+ebx*4]","","0","0",
"0x453d5b","0x 8B 16 ","mov edx,[esi]","","0","0",
"0x453d5d","0x 89 F1 ","mov ecx,esi","","0","0",
"0x453d5f","0x FF 52 30 ","call dword [edx+30h]","","0","0",
"0x453d62","0x 43 ","inc ebx","","0","0",
"0x453d63","0x 39 FB ","cmp ebx,edi","","0","0",
"0x453d65","0x 72 EC ","jb $-12h (0x453d53)","","0","0",
"0x453d67","0x 39 3D D8 1A 51 00 ","cmp [00511ad8h],edi","","0","0",
"0x453d6d","0x 0F 82 5A FF FF FF ","jb $-000000a0h (0x453ccd)","","0","0",
"0x453d73","0x 83 3D FC 88 51 00 00 ","cmp [005188fch],00h","","0","0",
"0x453d7a","0x 0F 85 4D FF FF FF ","jnz $-000000adh (0x453ccd)","","0","0",
"0x453d80","0x FF 0D E4 1A 51 00 ","dec dword [00511ae4h]","","0","0",
"0x453d86","0x 5F ","pop edi","","0","0",
"0x453d87","0x 5E ","pop esi","","0","0",
"0x453d88","0x 5B ","pop ebx","","0","0",
"0x453d89","0x 8B E5 ","mov esp,ebp","","0","0",
"0x453d8b","0x 5D ","pop ebp","","0","0",
"0x453d8c","0x C3 ","retnd","","0","0",
"0x453d8d","0x 90 ","nop","","0","0",
"0x453d8e","0x 90 ","nop","","0","0",
"0x453d8f","0x 90 ","nop","","0","0",
"0x453d90","0x 90 ","nop","","0","0",
"0x453d91","0x 90 ","nop","","0","0",
"0x453d92","0x 90 ","nop","","0","0",
"0x453d93","0x 90 ","nop","","0","0",
"0x453d94","0x 53 ","push ebx","","5.23","1068",
"0x453d95","0x 55 ","push ebp","","0","0",
"0x453d96","0x 8B 6C 24 0C ","mov ebp,[esp+0ch]","","0.22","45",
"0x453d9a","0x 56 ","push esi","","2.55","521",
"0x453d9b","0x 31 F6 ","xor esi,esi","","0.37","76",
"0x453d9d","0x 57 ","push edi","","0","0",
"0x453d9e","0x 89 CF ","mov edi,ecx","","0.32","65",
"0x453da0","0x 39 B7 8C 00 00 00 ","cmp [edi+0000008ch],esi","","2.29","467",
"0x453da6","0x 74 49 ","jz $+4bh (0x453df1)","","0","0",
"0x453da8","0x 8B 8F 94 00 00 00 ","mov ecx,[edi+00000094h]","","2.49","508",
"0x453dae","0x 8B 1C B1 ","mov ebx,[ecx+esi*4]","","12.29","2509",
"0x453db1","0x 3B DD ","cmp ebx,ebp","","6.68","1364",
"0x453db3","0x 75 0C ","jnz $+0eh (0x453dc1)","","0","0",
"0x453db5","0x 5F ","pop edi","","0","0",
"0x453db6","0x B8 01 00 00 00 ","mov eax,00000001h","","0","0",
"0x453dbb","0x 5E ","pop esi","","0","0",
"0x453dbc","0x 5D ","pop ebp","","0","0",
"0x453dbd","0x 5B ","pop ebx","","0","0",
"0x453dbe","0x C2 04 00 ","retnd 0004h","","0","0",
"0x453dc1","0x 83 7B 64 00 ","cmp [ebx+64h],00h","","3.28","669",
"0x453dc5","0x 75 21 ","jnz $+23h (0x453de8)","","15.68","3202",
"0x453dc7","0x C7 43 64 01 00 00 00 ","mov [ebx+64h],00000001h","","2.61","533",
"0x453dce","0x 8B CB ","mov ecx,ebx","","3.29","672",
"0x453dd0","0x 55 ","push ebp","","0.05","11",
"0x453dd1","0x E8 BE FF FF FF ","call $-0000003dh (0x453d94)","","0.25","51",
"0x453dd6","0x 85 C0 ","test eax,eax","","6.53","1333",
"0x453dd8","0x C7 43 64 00 00 00 00 ","mov [ebx+64h],00000000h","","0","0",
"0x453ddf","0x 74 07 ","jz $+09h (0x453de8)","","2.21","451",
"0x453de1","0x 5F ","pop edi","","0","0",
"0x453de2","0x 5E ","pop esi","","0","0",
"0x453de3","0x 5D ","pop ebp","","0","0",
"0x453de4","0x 5B ","pop ebx","","0","0",
"0x453de5","0x C2 04 00 ","retnd 0004h","","0","0",
"0x453de8","0x 46 ","inc esi","","3.4","695",
"0x453de9","0x 39 B7 8C 00 00 00 ","cmp [edi+0000008ch],esi","","5.71","1165",
"0x453def","0x 77 B7 ","jnbe $-47h (0x453da8)","","3.61","736",
"0x453df1","0x 5F ","pop edi","","1.93","394",
"0x453df2","0x 31 C0 ","xor eax,eax","","11.82","2413",
"0x453df4","0x 5E ","pop esi","","0.01","2",
"0x453df5","0x 5D ","pop ebp","","0.81","166",
"0x453df6","0x 5B ","pop ebx","","1.86","379",
"0x453df7","0x C2 04 00 ","retnd 0004h","","1.8","368",
"0x453dfa","0x 53 ","push ebx","","0","0",
"0x453dfb","0x 89 CA ","mov edx,ecx","","0","0",
"0x453dfd","0x 8B 44 24 08 ","mov eax,[esp+08h]","","0","0",
"0x453e01","0x 89 42 04 ","mov [edx+04h],eax","","0","0",
"0x453e04","0x 8B 5C 24 0C ","mov ebx,[esp+0ch]","","0","0",
"0x453e08","0x 8A 44 24 10 ","mov al,[esp+10h]","","0","0",
"0x453e0c","0x 88 42 08 ","mov [edx+08h],al","","0","0",
"0x453e0f","0x 89 C8 ","mov eax,ecx","","0","0",
"0x453e11","0x 89 1A ","mov [edx],ebx","","0","0",
"0x453e13","0x 5B ","pop ebx","","0","0",
"0x453e14","0x C2 0C 00 ","retnd 000ch","","0","0",
"0x453e17","0x 83 EC 10 ","sub esp,10h","","0","0",
"0x453e1a","0x 53 ","push ebx","","0","0",
"0x453e1b","0x 56 ","push esi","","0","0",
"0x453e1c","0x 89 CE ","mov esi,ecx","","0","0",
"0x453e1e","0x 57 ","push edi","","0","0",
"0x453e1f","0x 8D 4C 24 0C ","lea ecx,[esp+0ch]","","0","0",
"0x453e23","0x E8 54 B3 07 00 ","call $+0007b359h (0x4cf17c)","","0","0",
"0x453e28","0x 8B 46 04 ","mov eax,[esi+04h]","","0","0",
"0x453e2b","0x 85 C0 ","test eax,eax","","0","0",
"0x453e2d","0x 74 3B ","jz $+3dh (0x453e6a)","","0","0",
"0x453e2f","0x 83 78 04 00 ","cmp [eax+04h],00h","","0","0",
"0x453e33","0x 74 35 ","jz $+37h (0x453e6a)","","0","0",
"0x453e35","0x 31 DB ","xor ebx,ebx","","0","0",
"0x453e37","0x 39 58 04 ","cmp [eax+04h],ebx","","0","0",
"0x453e3a","0x 74 2E ","jz $+30h (0x453e6a)","","0","0",
"0x453e3c","0x 8B 56 04 ","mov edx,[esi+04h]","","0","0",
"0x453e3f","0x 8B 4A 0C ","mov ecx,[edx+0ch]","","0","0",
"0x453e42","0x 8B 3C 99 ","mov edi,[ecx+ebx*4]","","0","0",
"0x453e45","0x 8B 17 ","mov edx,[edi]","","0","0",
"0x453e47","0x 89 F9 ","mov ecx,edi","","0","0",
"0x453e49","0x FF 52 14 ","call dword [edx+14h]","","0","0",
"0x453e4c","0x 50 ","push eax","","0","0",
"0x453e4d","0x 8D 4C 24 10 ","lea ecx,[esp+10h]","","0","0",
"0x453e51","0x E8 1E B4 07 00 ","call $+0007b423h (0x4cf274)","","0","0",
"0x453e56","0x 6A 2E ","push byte 2eh","","0","0",
"0x453e58","0x 8D 4C 24 10 ","lea ecx,[esp+10h]","","0","0",
"0x453e5c","0x E8 8B B4 07 00 ","call $+0007b490h (0x4cf2ec)","","0","0",
"0x453e61","0x 8B 56 04 ","mov edx,[esi+04h]","","0","0",
"0x453e64","0x 43 ","inc ebx","","0","0",
"0x453e65","0x 39 5A 04 ","cmp [edx+04h],ebx","","0","0",
"0x453e68","0x 77 D2 ","jnbe $-2ch (0x453e3c)","","0","0",
"0x453e6a","0x 8B 0E ","mov ecx,[esi]","","0","0",
"0x453e6c","0x 8B 11 ","mov edx,[ecx]","","0","0",
"0x453e6e","0x FF 52 14 ","call dword [edx+14h]","","0","0",
"0x453e71","0x 50 ","push eax","","0","0",
"0x453e72","0x 8D 4C 24 10 ","lea ecx,[esp+10h]","","0","0",
"0x453e76","0x E8 F9 B3 07 00 ","call $+0007b3feh (0x4cf274)","","0","0",
"0x453e7b","0x 6A 00 ","push byte 00h","","0","0",
"0x453e7d","0x 8D 4C 24 10 ","lea ecx,[esp+10h]","","0","0",
"0x453e81","0x E8 66 B4 07 00 ","call $+0007b46bh (0x4cf2ec)","","0","0",
"0x453e86","0x 8D 4C 24 0C ","lea ecx,[esp+0ch]","","0","0",
"0x453e8a","0x E8 55 B3 07 00 ","call $+0007b35ah (0x4cf1e4)","","0","0",

Reply via email to