-
Notifications
You must be signed in to change notification settings - Fork 9
PerformanceCoding
oguyon edited this page Mar 10, 2020
·
2 revisions
A few guidelines to provide information to the compiler (and the programmer).
Use const
const float pi = 3.14;
printf("pi = %f\n", pi);
Use restrict type qualifying for non-aliased pointers
errno_t examplefunction(
const char *__restrict__ stringinput
)
{
printf("string : %s\n", stringinput);
return RETURN_SUCCESS;
}
For details, see GCC Common Function Attributes
void __attribute__ ((pure)) myfunction()
{
// function that has no observable effects on the state of the program other than to return a value
}
void __attribute__ ((hot)) myfunction()
{
// some performance-critical code
}
void __attribute__ ((cold)) myfunction()
{
// some non-performance-critical code
}
compute and control for adaptive optics (cacao) - https://github.com/cacao-org/cacao
- Real-Time OS install
- OS Performance Tuning
- Real-time OS benchmarks:
- GPU drivers and tools
- cacao Performance