flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > Differences in compile time for different code Goto page 1, 2 Next |
Author |
|
system error 12 Dec 2016, 23:20
I don't think it's the code though. I suspect something from the compile optimization?
|
|||
12 Dec 2016, 23:20 |
|
revolution 13 Dec 2016, 00:20
I would suspect alignment. Something is probably crossing a cache boundary. Shifting the output code up or down by a few bytes does affect the compile time.
|
|||
13 Dec 2016, 00:20 |
|
system error 13 Dec 2016, 00:43
mom, this is just a small code. Cache won't be that big of an issue, IMO. Could it be that FASM has special 'arrangement' for framed stack vs naked stack?
|
|||
13 Dec 2016, 00:43 |
|
revolution 13 Dec 2016, 01:21
system error wrote: mom, this is just a small code. system error wrote: Cache won't be that big of an issue, IMO. system error wrote: Could it be that FASM has special 'arrangement' for framed stack vs naked stack? |
|||
13 Dec 2016, 01:21 |
|
system error 13 Dec 2016, 01:36
Doesn't work either. I think with align 32, there should be enough nops up there. Injecting another one will induce an odd address for cache pickup. It must be something else.
|
|||
13 Dec 2016, 01:36 |
|
revolution 13 Dec 2016, 01:45
Don't use align, just put in a single, or two, or three, nop(s) as the first instruction(s) to show the effect.
BTW: If you post your entire test code with whatever 10 million looping setup you have then others can test it also. |
|||
13 Dec 2016, 01:45 |
|
system error 13 Dec 2016, 01:59
Now it compiles in 4.5 secs. ho ho ho. This is interesting! I am moving to PC now to see how it behaves.
|
|||
13 Dec 2016, 01:59 |
|
AsmGuru62 13 Dec 2016, 21:00
I had a project once: 5Mb of code files (~50 files) - compiled in ~1 sec.
You're saying the code you posted compiles in 4.5 sec?! I must be missing something. |
|||
13 Dec 2016, 21:00 |
|
system error 14 Dec 2016, 09:16
gee i don't know AsmGuru62... maybe you're missing your brain, perhaps?
Here's the code to test. Test the compile time for both cases a. When enter/leave disabled b. When enter/leave enabled Your time may differ but still such compile anomaly persists.
|
|||||||||||
14 Dec 2016, 09:16 |
|
fragment 14 Jan 2017, 18:28
testResults on my Laptop (Celeron-N2830/Silvermont):
fasm (version: 1.71.57) compile time: enter/leave on = 0.1 - 0.2 seconds enter/leave off = 0.7 - 0.8 seconds ps: so your trend continues, the more code the faster. looks like a lot of extra work in the future |
|||
14 Jan 2017, 18:28 |
|
Tomasz Grysztar 14 Jan 2017, 18:45
Do you have any antivirus software monitoring your file accesses? Perhaps it detects something suspicious in the ENTER/LEAVE variant and its interferes with fasm writing the executable file? On my machine I see no difference in compile time between the two variants.
|
|||
14 Jan 2017, 18:45 |
|
system error 15 Jan 2017, 22:35
Tomasz, it could be something to do with your table entry, especially those ending with 0. "entry" is one of them. I don't know what exactly the problem is because I don't really understand your table, but it could be the suspect.
|
|||
15 Jan 2017, 22:35 |
|
Tomasz Grysztar 16 Jan 2017, 12:51
There is nothing special about these entries, 0 is the value of parameter passed to the instruction handler, for "enter" handler this parameter is not used at all and can be any other value.
The behavior that you describe is very irregular, currently I have no way of reproducing on my own. |
|||
16 Jan 2017, 12:51 |
|
system error 17 Jan 2017, 10:44
Ok.
But it's weird though. I tested it on Linux and other PCs, still the same anomaly. The compile time is back to normal speed only after I replaced / injected them with any entries ending with 0 (e.g, xchg, bswap, enter). But it's probably nothing. |
|||
17 Jan 2017, 10:44 |
|
revolution 18 Jan 2017, 09:33
system error wrote: Your time may differ but still such compile anomaly persists. Code: C:\Documents and Settings\We are the Borg\Our Documents>fasm testit1.asm flat assembler version 1.71.58 (3145344 kilobytes memory) 3 passes, 0.1 seconds, 2048 bytes. C:\Documents and Settings\We are the Borg\Our Documents>fasm testit2.asm flat assembler version 1.71.58 (3145344 kilobytes memory) 3 passes, 0.1 seconds, 2048 bytes. C:\Documents and Settings\We are the Borg\Our Documents>fc testit1.asm testit2.asm Comparing files testit1.asm and testit2.asm ***** testit1.asm StringCopy: ;enter 0,0 push rsi rdi rcx rdx rbx ***** testit2.asm StringCopy: enter 0,0 push rsi rdi rcx rdx rbx ***** ***** testit1.asm pop rbx rdx rcx rdi rsi ;leave ret ***** testit2.asm pop rbx rdx rcx rdi rsi leave ret ***** |
|||
18 Jan 2017, 09:33 |
|
redsock 18 Jan 2017, 19:58
Isn't it sposed to be "We are Borg?"
|
|||
18 Jan 2017, 19:58 |
|
revolution 19 Jan 2017, 02:16
redsock wrote: Isn't it sposed to be "We are Borg?" |
|||
19 Jan 2017, 02:16 |
|
system error 19 Jan 2017, 17:20
I don't know revo. This is the result on both 'my systems'. It seems consistent with fragment's finding.
Code: D:\FASMW57>fasm testit.asm flat assembler version 1.71.57 (863059 kilobytes memory) 3 passes, 0.1 seconds, 2048 bytes. ;ENTER/LEAVE enabled D:\FASMW57>fasm testit.asm flat assembler version 1.71.57 (863943 kilobytes memory) 3 passes, 0.7 seconds, 2048 bytes. D:\FASMW57>fasm testit.asm flat assembler version 1.71.57 (861630 kilobytes memory) 3 passes, 0.8 seconds, 2048 bytes. D:\FASMW57>fasm testit.asm flat assembler version 1.71.57 (861117 kilobytes memory) 3 passes, 0.8 seconds, 2048 bytes. D:\FASMW57>fasm testit.asm flat assembler version 1.71.57 (861255 kilobytes memory) 3 passes, 0.7 seconds, 2048 bytes. |
|||
19 Jan 2017, 17:20 |
|
JohnFound 19 Jan 2017, 17:42
In Linux on slower CPU and with Fresh IDE (FASM 1.71.58 ) I didn't found any measurable difference. For both versions:
Preprocessing time: 150..170ms Parsing: 40ms Assembling: 9ms Formatting: 50ms |
|||
19 Jan 2017, 17:42 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.