ziglang/zig

automatic profile guided optimization in release modes based on test cases

andrewrk opened this issue · 1 comments

Research idea:

Have a set of test cases that are designed to mimic real world payload.

Zig compiler tries various optimization techniques, runs these tests, collects performance statistics, analyzes the results of the performance statistics to try different optimization techniques, and then finally settles on an optimization strategy informed by this process.

This can be used to inform which functions to inline, which parts of the code to apply certain optimization passes to, which parts of the code to perhaps not do this (maybe the instruction cache size was important there), and in other words have an optimization process guided by test data. I believe GCC has already paved the way for a lot of this research.

Would making sure that non-inlined functions that frequently call each other are placed in close proximity to each other in order to improve the instruction cache locality also be a thing that could be considered when performing such research?