embench / embench-iot

The main Embench repository
https://www.embench.org/
GNU General Public License v3.0
259 stars 105 forks source link

Why do we benchmark size using .text and not .text and .rodata? #118

Closed Roger-Shepherd closed 3 years ago

Roger-Shepherd commented 3 years ago

See issue #117 for some background

Since the program and read only data have to be loaded into memory before execution can occur it would seem sensible that the size of an executable included .rodata as well as .text. This is a particular issue as there are often choices about how (constant) data is loaded - e.g. instructions with literals v. load from initialised memory.

Apologies if this choice is documented, I couldn't find it on GitHub

jeremybennett commented 3 years ago

There are arguments for a number of variants, which were discussed early on. The benchmark_size.py script can actually compute any of these, the default is just .text.

We went with .text because it is simplest, and most relevant to code optimization. Of course there are optimizations which are data driven and so can trade space in .text and the various data segments.

HTH, Jeremy

Roger-Shepherd commented 3 years ago

Thanks. I can also see the answer to issue #119 coming from this.......