For a project I intend to compile various *NIX OSs and their relative packages with different CPUs in order to maximize optimization and performance for specific systems. In order to save time and money I'd like to know if there really is a difference between compiling code with similar architectures.
For example: If I compile Debian GNU/Linux + all the packages of the default repos with an Intel Core i7-8700 and use the OS on a system with an Intel Core i7-8650U, will it perform the same as if I compiled everything with the i7-8650U or would I lose some performance? (I don't care about the percentage, I'd like to know even if it were 1%)
To put it shortly is there an amount of worth grater than zero (0) in compiling code on different CPU models of the same generation? Because if that wasn't the case I'd just take one CPU from every generation from every manufacturer and call it a day for all the other models.