dotnet / fsharp

The F# compiler, F# core library, F# language service, and F# tooling integration for Visual Studio
https://dotnet.microsoft.com/languages/fsharp
MIT License
3.82k stars 773 forks source link

Enable PGO #17286

Closed psfinaki closed 5 days ago

psfinaki commented 3 weeks ago

Description

Fixes #12636 Fixes #13328

Benchmarks

I published FSI and FSC locally for net 8.0 and win-64 runtime, then ran them against an empty F# script.

FSI results

image

Before:

First run: ~2.9 s Later runs: ~1.4 s

After:

First run: ~1.7 s Later runs: ~0.9 s

FSC results

image

Before:

First run: ~2.9 s Later runs: ~1.9 s

After:

First run: ~1.8 s Later runs: ~1.0 s


The improvements are about 40% in all cases!

Checklist

github-actions[bot] commented 3 weeks ago

:white_check_mark: No release notes required

psfinaki commented 2 weeks ago

/azp run

azure-pipelines[bot] commented 2 weeks ago
Azure Pipelines successfully started running 2 pipeline(s).
vzarytovskii commented 2 weeks ago

@EgorBo we don't really want to do the profile generation ourselves, can't we just consume what you're publishing already for fsi and contribute some tests for the fsc?

EgorBo commented 2 weeks ago

@EgorBo we don't really want to do the profile generation ourselves, can't we just consume what you're publishing already for fsi and contribute some tests for the fsc?

I guess it's up to you, I'd also recommend consuming the MIBC from nuget and use the same workflow that we use in dotnet/runtime where training is done in a separate repo. I thought that you decided to do the training here in this repo, if you don't then I'd also vote for just consuming the MIBC from the nuget

vzarytovskii commented 2 weeks ago

@EgorBo we don't really want to do the profile generation ourselves, can't we just consume what you're publishing already for fsi and contribute some tests for the fsc?

I guess it's up to you, I'd also recommend consuming the MIBC from nuget and use the same workflow that we use in dotnet/runtime where training is done in a separate repo. I thought that you decided to do the training here in this repo, if you don't then I'd also vote for just consuming the MIBC from the nuget

Yeah, I'd say it would be easier for us to consume ready to use profiles, in case if something changes in generating them, we don't have to adjust ours

psfinaki commented 5 days ago

Closing in favor of #17317