Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce memory footprint and improve performance of expression-based ORM usage #10522

Open
bessgeor opened this issue Nov 22, 2020 · 0 comments
Open
Labels
Feature Improvement Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code. Theme-Performance
Milestone

Comments

@bessgeor
Copy link

Repro steps

  1. clone https://github.com/bessgeor/benchmark-fsharp-csharp-query-building
  2. run dotnet tools restore
  3. run cd ./BuildQuery.Benchmark
  4. run dotnet publish -c Release -m
  5. run dotnet ./bin/Release/netcoreapp3.1/publish/BuildQuery.Benchmark.dll

Expected behavior

F#'s performance is slighly lower than C#'s because of Quotation->Expression conversion

Actual behavior

F# is 6x times slower (~0.65ms more per call) and allocates 10x times more (~453 KiB more per call)

Known workarounds

Query compilation may move this costs to startup time, but it's blocked by #2758 and may not be used on every query.

Related information

Provide any related information (optional):

  • OS Windows 10.0.19041.630
  • .NET Runtime .NET Core 3.1.5 (CoreCLR 4.700.20.26901, CoreFX 4.700.20.27001)
  • Editor Rider 16.2.4
@bessgeor bessgeor changed the title Expression-based ORM usage is 6x slower and allocates an order of magnitude more than C# Improve memory footprint and performance of expression-based ORM usage Nov 22, 2020
@bessgeor bessgeor changed the title Improve memory footprint and performance of expression-based ORM usage Reduce memory footprint and improve performance of expression-based ORM usage Nov 22, 2020
@cartermp cartermp added this to the Backlog milestone Nov 24, 2020
@KevinRansom KevinRansom added Feature Improvement Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code. labels Jul 21, 2021
@vzarytovskii vzarytovskii moved this to Not Planned in F# Compiler and Tooling Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Improvement Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code. Theme-Performance
Projects
Status: New
Development

No branches or pull requests

5 participants