I want to install linux on my new computer that has dual Intel Xeon processors. I would like to have a distro that can help optimise the performance and the use of both of the cpus. Some of the candidates that I have looked at are cachy os which seems to have more out of the box performance optimisations, and gentoo which allows you to compile programs for two cpus with a flag. What would be the most daily driver friendly way to use the two cpus with linux. I have been using linux for around 2 years so I am comfortable with the terminal and more complicated distributions.
Optimize performance for what?
Seriously. This is the question you need to answer.
Dual xeon sounds like you have some kind of server motherboard with two distinct multicore xeon processors. Which would make your question partially make sense because your memory would be split into two NUMA nodes and cause all kinds of weird issues for generic workloads.
Usually these servers run specialized software that is implemented to handle this case, but generic software (browsers, games) does not. Just recompiling and choosing a distro will not solve your issues. You are probably better off disabling one cpu and numa node or configuring them to not run, to avoid the data split.
If you want to optimize for server workloads for server software (webserver, db software) then a good and stable server distro is all you need (debian, almalinux).