Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Philipp Klaus Krause <pkk@spth.de> |
|---|---|
| Newsgroups | comp.std.c |
| Subject | Re: register at file scope |
| Date | 2019-11-25 12:19 +0100 |
| Organization | solani.org |
| Message-ID | <qrgdc1$qv7$1@solani.org> (permalink) |
| References | (2 earlier) <qp1vg1$jr5$1@solani.org> <qp3vl6$j5h$1@dont-email.me> <qp6j0d$kaq$1@solani.org> <qp6tuh$14r$1@dont-email.me> <qp8v2t$6hf$1@solani.org> |
Am 29.10.19 um 10:00 schrieb Philipp Klaus Krause: > Introducing this as a compiler extension first and also evaluate the > impact of placing register in appropriate places in some real-world code > or a benchmark would indeed make sense. > > Philipp > I did a first experiment; there, the improvements in benchmarks are far less than what one sees in synthetic examples. Experiment: * SDCC version based on current SDCC with support for register at file scope added. For now, the information is used in two places in redundancy elimination only. * Annotated file scope variables in 4 benchmarks (Coremark, Dhrystone, stdcbench, Whetstone) with register storage class where appropriate. * Compiled the benchmarks for STM8 with strong optimization (--max-allocs-per-node 100000), using default balanced optimization goal. Results: * stdcbench, Coremark: No difference at all. No surprise, since they both use very few file scope variables, and typically not in the inner loops. * Whetstone: 0.8 % increase in score, 0.3 % reduction in code size. Whtstone uses some file scope variables, but doesn't do much with pointers, so no surprise here, either. * Dhrystone: 1.4 % increase in score, 0.1 % increase in code size. IMO, 1.4 % is a surprisingly large increase, considering that Dhrystone tends to spent most of its time in string functions from the standard library, which are not affected by the change at all. Philipp
Back to comp.std.c | Previous | Next — Previous in thread | Find similar | Unroll thread
register at file scope Philipp Klaus Krause <pkk@spth.de> - 2019-10-25 12:45 +0200
Re: register at file scope David Brown <david.brown@hesbynett.no> - 2019-10-26 17:33 +0200
Re: register at file scope Philipp Klaus Krause <pkk@spth.de> - 2019-10-26 19:24 +0200
Re: register at file scope David Brown <david.brown@hesbynett.no> - 2019-10-27 12:39 +0100
Re: register at file scope Philipp Klaus Krause <pkk@spth.de> - 2019-10-28 12:22 +0100
Re: register at file scope David Brown <david.brown@hesbynett.no> - 2019-10-28 15:28 +0100
Re: register at file scope Philipp Klaus Krause <pkk@spth.de> - 2019-10-29 10:00 +0100
Re: register at file scope David Brown <david.brown@hesbynett.no> - 2019-10-29 13:46 +0100
Re: register at file scope Philipp Klaus Krause <pkk@spth.de> - 2019-11-25 12:19 +0100
csiph-web