Any thoughts on what would be in a good piece of source code to use to
test a compiler's speed?
I guess I could do with something that's (1) realistic, not just an assignment statement repeated over and over again, (2) large enough to
give lengthy timings, (3) easy enough to make, and (4) it would be valid over multiple generations of the compiler. But what should be in it?
Here are some comparative timings taken just now. They read and compile
my parser (as it's the largest source file in the compiler). It is about
18k in size and from it the compiler produces am asm file of a little
over 100k.
cda 566 ms
cdb 540 ms
cdc 600 ms
cdd 24 ms
The reason for the gratifying jump in performance at the end is that I
added input and output buffering to cdd but it's got me wondering about testing the times taken by future compilers.
I should say that I don't expect compile times always to improve. The
run times of later compilers would likely go up as I add facilities and
down as I switch to other mechanisms. But it would still be something
I'd like to keep an eye on.
--So you don't care about how fast the generated code runs, instead focusing on how fast the program compiles?
James Harris
On Saturday, November 5, 2022 at 11:03:47 AM UTC-4, James Harris wrote:
Any thoughts on what would be in a good piece of source code to use to
test a compiler's speed?
I guess I could do with something that's (1) realistic, not just an
assignment statement repeated over and over again, (2) large enough to
give lengthy timings, (3) easy enough to make, and (4) it would be valid
over multiple generations of the compiler. But what should be in it?
Here are some comparative timings taken just now. They read and compile
my parser (as it's the largest source file in the compiler). It is about
18k in size and from it the compiler produces am asm file of a little
over 100k.
cda 566 ms
cdb 540 ms
cdc 600 ms
cdd 24 ms
The reason for the gratifying jump in performance at the end is that I
added input and output buffering to cdd but it's got me wondering about
testing the times taken by future compilers.
I should say that I don't expect compile times always to improve. The
run times of later compilers would likely go up as I add facilities and
down as I switch to other mechanisms. But it would still be something
I'd like to keep an eye on.
So you don't care about how fast the generated code runs, instead focusing on how fast the program compiles?
That seems irrelevant to me since you're going to compile only once or a few times to debug it but run the program many times (if it's useful)
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 830 |
Nodes: | 10 (0 / 10) |
Uptime: | 63:54:46 |
Calls: | 11,511 |
Files: | 186,253 |
Messages: | 1,820,907 |