You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -49,7 +49,7 @@ Install the latest released [Visual Studio](https://visualstudio.microsoft.com/v
49
49
* .NET desktop development (also check F# desktop support, as this will install some legacy templates)
50
50
* Visual Studio extension development
51
51
52
-
You will also need the latest .NET 7 SDK installed from [here](https://dotnet.microsoft.com/download/dotnet/7.0).
52
+
You will also need .NET SDK installed from [here](https://dotnet.microsoft.com/download/dotnet), exact version can be found in the global.json file in the root of the repository.
53
53
54
54
Building is simple:
55
55
@@ -76,7 +76,7 @@ If you are just developing the core compiler and library then building ``FSharp.
76
76
We recommend installing the latest Visual Studio preview and using that if you are on Windows. However, if you prefer not to do that, you will need to install the following:
*[.NET SDK](https://dotnet.microsoft.com/download/dotnet) (see exact version in global.json file in the repository root).
80
80
81
81
You'll need to pass an additional flag to the build script:
82
82
@@ -275,9 +275,25 @@ Where `<version>` corresponds to the latest Visual Studio version on your machin
275
275
276
276
Use the `Debug` configuration to test your changes locally. It is the default. Do not use the `Release` configuration! Local development and testing of Visual Studio tooling is not designed for the `Release` configuration.
277
277
278
-
### Writing and running benchmarks
278
+
### Benchmarking
279
279
280
-
Existing compiler benchmarks can be found in `tests\benchmarks\`.
280
+
Existing compiler benchmarks can be found in `tests\benchmarks\`. The folder contains READMEs describing specific benchmark projects as well as guidelines for creating new benchmarks. There is also `FSharp.Benchmarks.sln` solution containing all the benchmark project and their dependencies.
281
+
282
+
To exercise the benchmarking infrastructure locally, run:
This is executed in CI as well. It does the following:
295
+
- builds all the benchmarking projects
296
+
- does smoke testing for fast benchmarks (executes them once to check they don't fail in the runtime)
281
297
282
298
### Benchmarking and profiling the compiler
283
299
@@ -286,151 +302,6 @@ Existing compiler benchmarks can be found in `tests\benchmarks\`.
286
302
* Always build both versions of compiler/FCS from source and not use pre-built binaries from SDK (SDK binaries are crossgen'd, which can affect performance).
287
303
* To run `Release` build of compiler/FCS.
288
304
289
-
### Example benchmark setup using [BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet)
290
-
291
-
1. Perform a clean build of the compiler and FCS from source (as described in this document, build can be done with `-noVisualStudio` in case if FCS/FSharp.Core is being benchmarked/profiled).
292
-
293
-
2. Create a benchmark project (in this example, the project will be created in `tests\benchmarks\FCSBenchmarks`).
294
-
295
-
```shell
296
-
cd tests\benchmarks\FCSBenchmarks
297
-
dotnet new console -o FcsBench --name FcsBench -lang F#
> For more detailed information about available BenchmarkDotNet options, please refer to [BenchmarkDotNet Documentation](https://benchmarkdotnet.org/articles/overview.html).
387
-
388
-
6. Build and run the benchmark.
389
-
390
-
```shell
391
-
dotnet build -c Release
392
-
dotnet run -c Release
393
-
```
394
-
395
-
7. You can find results in`.\BenchmarkDotNet.Artifacts\results\`in the current benchmark project directory.
| ParsingTypeCheckerFs | 199.4 ms | 3.84 ms | 9.78 ms | 195.5 ms | 4000.0000 | 1000.0000 | 28 MB |
430
-
431
-
8. Repeat for any number of changes you would like to test.
432
-
9. **Optionally:** benchmark code and results can be included as part of the PR for future reference.
433
-
434
305
## Additional resources
435
306
436
307
The primary technical guide to the core compiler code is [The F# Compiler Technical Guide](https://github.com/dotnet/fsharp/blob/main/docs/index.md). Please read and contribute to that guide.
<!-- It's important we set TFM before this, since FSharpTests.Directory.Build.props uses it.
64
+
TODO(vlza): this build props looks outdated, since we only use $(FSharpTestCompilerVersion) in TP tests or cambridge suite (which we slowly want to migrate to xUnit).
0 commit comments