From 057d15e7bfc211abfff951816c9e645780a17123 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Thu, 4 Jul 2019 17:20:46 +0200 Subject: [PATCH] Reorganized benchmarks For cleaner project structure - inherited projects like in tests. Various other cleanup modifications, but no functional changes. --- EFCore.sln | 16 +++++- .../EF.Benchmarks.Shared.csproj | 12 ++++ .../EFCoreBenchmarkRunner.cs | 54 ++++++++++++++++++ .../Initialization/ColdStartSandbox.cs | 0 .../Models/AdventureWorks/Address.cs | 0 .../Models/AdventureWorks/AddressType.cs | 0 .../Models/AdventureWorks/BillOfMaterials.cs | 0 .../Models/AdventureWorks/BusinessEntity.cs | 0 .../AdventureWorks/BusinessEntityAddress.cs | 0 .../AdventureWorks/BusinessEntityContact.cs | 0 .../Models/AdventureWorks/ContactType.cs | 0 .../Models/AdventureWorks/CountryRegion.cs | 0 .../AdventureWorks/CountryRegionCurrency.cs | 0 .../Models/AdventureWorks/CreditCard.cs | 0 .../Models/AdventureWorks/Culture.cs | 0 .../Models/AdventureWorks/Currency.cs | 0 .../Models/AdventureWorks/CurrencyRate.cs | 0 .../Models/AdventureWorks/Customer.cs | 0 .../Models/AdventureWorks/Department.cs | 0 .../Models/AdventureWorks/EmailAddress.cs | 0 .../Models/AdventureWorks/Employee.cs | 0 .../EmployeeDepartmentHistory.cs | 0 .../AdventureWorks/EmployeePayHistory.cs | 0 .../Models/AdventureWorks/Illustration.cs | 0 .../Models/AdventureWorks/JobCandidate.cs | 0 .../Models/AdventureWorks/Location.cs | 0 .../Models/AdventureWorks/Password.cs | 0 .../Models/AdventureWorks/Person.cs | 0 .../Models/AdventureWorks/PersonCreditCard.cs | 0 .../Models/AdventureWorks/PersonPhone.cs | 0 .../Models/AdventureWorks/PhoneNumberType.cs | 0 .../Models/AdventureWorks/Product.cs | 0 .../Models/AdventureWorks/ProductCategory.cs | 0 .../AdventureWorks/ProductCostHistory.cs | 0 .../AdventureWorks/ProductDescription.cs | 0 .../Models/AdventureWorks/ProductDocument.cs | 0 .../Models/AdventureWorks/ProductInventory.cs | 0 .../AdventureWorks/ProductListPriceHistory.cs | 0 .../Models/AdventureWorks/ProductModel.cs | 0 .../ProductModelIllustration.cs | 0 .../ProductModelProductDescriptionCulture.cs | 0 .../Models/AdventureWorks/ProductPhoto.cs | 0 .../AdventureWorks/ProductProductPhoto.cs | 0 .../Models/AdventureWorks/ProductReview.cs | 0 .../AdventureWorks/ProductSubcategory.cs | 0 .../Models/AdventureWorks/ProductVendor.cs | 0 .../AdventureWorks/PurchaseOrderDetail.cs | 0 .../AdventureWorks/PurchaseOrderHeader.cs | 0 .../Models/AdventureWorks/SalesOrderDetail.cs | 0 .../Models/AdventureWorks/SalesOrderHeader.cs | 0 .../SalesOrderHeaderSalesReason.cs | 0 .../Models/AdventureWorks/SalesPerson.cs | 0 .../AdventureWorks/SalesPersonQuotaHistory.cs | 0 .../Models/AdventureWorks/SalesReason.cs | 0 .../Models/AdventureWorks/SalesTaxRate.cs | 0 .../Models/AdventureWorks/SalesTerritory.cs | 0 .../AdventureWorks/SalesTerritoryHistory.cs | 0 .../Models/AdventureWorks/ScrapReason.cs | 0 .../Models/AdventureWorks/Shift.cs | 0 .../Models/AdventureWorks/ShipMethod.cs | 0 .../Models/AdventureWorks/ShoppingCartItem.cs | 0 .../Models/AdventureWorks/SpecialOffer.cs | 0 .../AdventureWorks/SpecialOfferProduct.cs | 0 .../Models/AdventureWorks/StateProvince.cs | 0 .../Models/AdventureWorks/Store.cs | 0 .../AdventureWorks/TransactionHistory.cs | 0 .../TransactionHistoryArchive.cs | 0 .../Models/AdventureWorks/UnitMeasure.cs | 0 .../Models/AdventureWorks/Vendor.cs | 0 .../Models/AdventureWorks/WorkOrder.cs | 0 .../Models/AdventureWorks/WorkOrderRouting.cs | 0 .../Models/Orders/Customer.cs | 0 .../Models/Orders/Order.cs | 0 .../Models/Orders/OrderLine.cs | 0 .../Models/Orders/OrdersFixtureSeedBase.cs | 0 .../Models/Orders/Product.cs | 0 .../ParamsSummaryColumn.cs | 0 .../ChangeTracker/DbSetOperationTests.cs | 0 .../ChangeTracker/FixupTests.cs | 0 .../ChangeTracker/SingleRunJobAttribute.cs | 0 .../EF6.SqlServer.Benchmarks.csproj} | 2 +- .../Initialization/InitializationTests.cs | 0 .../AdventureWorks/AdventureWorksContext.cs | 0 .../AdventureWorks/AdventureWorksFixture.cs | 4 +- .../Models/Orders/OrdersContext.cs | 0 .../Models/Orders/OrdersFixture.cs | 2 +- .../Query/FuncletizationTests.cs | 0 .../Query/NavigationsQueryTests.cs | 0 .../Query/QueryCompilationTests.cs | 0 .../Query/RawSqlQueryTests.cs | 0 .../Query/SimpleQueryTests.cs | 0 .../Support}/Extensions.cs | 1 + .../Support/Program.cs | 23 ++++++++ .../Support/SqlServerBenchmarkEnvironment.cs | 34 +++++++++++ .../SimpleUpdatePipelineTests.cs | 0 .../EF6.SqlServer.Benchmarks/config.json | 5 ++ .../ChangeTracker/DbSetOperationTests.cs | 0 .../ChangeTracker/FixupTests.cs | 0 .../EFCore.Benchmarks.csproj | 37 ++++++++++++ .../Extensions/Extensions.cs | 0 .../Initialization/ColdStartEnabledTests.cs | 0 .../Initialization/InitializationTests.cs | 0 .../AdventureWorksContextBase.cs | 0 .../Models/Orders/OrdersContextBase.cs | 0 .../Models/Orders/OrdersFixtureBase.cs | 0 .../Query/FuncletizationTests.cs | 0 .../Query/NavigationsQueryTests.cs | 0 .../Query/QueryCompilationTests.cs | 0 .../Query/RawSqlQueryTests.cs | 0 .../Query/SimpleQueryTests.cs | 0 .../SimpleUpdatePipelineTests.cs | 0 .../DbSetOperationSqlServerTests.cs | 4 +- .../ChangeTracker/FixupSqlServerTests.cs | 4 +- .../EFCore.SqlServer.Benchmarks.csproj | 13 ++--- .../ColdStartEnabledSqlServerTest.cs | 2 +- ...t.cs => AdventureWorksSqlServerContext.cs} | 4 +- ...e.cs => AdventureWorksSqlServerFixture.cs} | 6 +- ...rsContext.cs => OrdersSqlServerContext.cs} | 4 +- ...rsFixture.cs => OrdersSqlServerFixture.cs} | 8 +-- .../Query/FuncletizationSqlServerTests.cs | 2 +- .../Query/NavigationsQuerySqlServerTests.cs | 2 +- .../Query/QueryCompilationSqlServerTests.cs | 2 +- .../Query/RawSqlQuerySqlServerTests.cs | 2 +- .../Query/SimpleQuerySqlServerTests.cs | 2 +- .../Support/Program.cs | 23 ++++++++ .../Support/SqlServerBenchmarkEnvironment.cs | 39 +++++++++++++ .../SimpleUpdatePipelineSqlServerTests.cs | 8 +-- .../EFCore.SqlServer.Benchmarks/config.json | 10 ---- .../config.json | 10 ---- .../DbSetOperationSqliteTests.cs | 4 +- .../ChangeTracker/FixupSqliteTests.cs | 4 +- .../EFCore.Sqlite.Benchmarks.csproj | 21 +++---- .../ColdStartEnabledSqliteTest.cs | 2 +- ...text.cs => AdventureWorksSqliteContext.cs} | 4 +- ...ture.cs => AdventureWorksSqliteFixture.cs} | 6 +- ...rdersContext.cs => OrdersSqliteContext.cs} | 4 +- ...rdersFixture.cs => OrdersSqliteFixture.cs} | 8 +-- .../Query/FuncletizationSqliteTests.cs | 2 +- .../Query/NavigationsQuerySqliteTests.cs | 2 +- .../Query/QueryCompilationSqliteTests.cs | 2 +- .../Query/RawSqlQuerySqliteTests.cs | 2 +- .../Query/SimpleQuerySqliteTests.cs | 2 +- .../Support/Program.cs | 23 ++++++++ .../SimpleUpdatePipelineSqliteTests.cs | 8 +-- .../EFCore.Sqlite.Benchmarks/config.json | 10 ---- benchmark/Shared/BenchmarkEnvironment.cs | 45 --------------- benchmark/Shared/Program.cs | 56 ------------------- 147 files changed, 333 insertions(+), 207 deletions(-) create mode 100644 benchmark/EF.Benchmarks.Shared/EF.Benchmarks.Shared.csproj create mode 100644 benchmark/EF.Benchmarks.Shared/EFCoreBenchmarkRunner.cs rename benchmark/{Shared => EF.Benchmarks.Shared}/Initialization/ColdStartSandbox.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/Address.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/AddressType.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/BillOfMaterials.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/BusinessEntity.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/BusinessEntityAddress.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/BusinessEntityContact.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/ContactType.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/CountryRegion.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/CountryRegionCurrency.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/CreditCard.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/Culture.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/Currency.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/CurrencyRate.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/Customer.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/Department.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/EmailAddress.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/Employee.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/EmployeeDepartmentHistory.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/EmployeePayHistory.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/Illustration.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/JobCandidate.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/Location.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/Password.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/Person.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/PersonCreditCard.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/PersonPhone.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/PhoneNumberType.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/Product.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/ProductCategory.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/ProductCostHistory.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/ProductDescription.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/ProductDocument.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/ProductInventory.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/ProductListPriceHistory.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/ProductModel.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/ProductModelIllustration.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/ProductModelProductDescriptionCulture.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/ProductPhoto.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/ProductProductPhoto.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/ProductReview.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/ProductSubcategory.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/ProductVendor.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/PurchaseOrderDetail.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/PurchaseOrderHeader.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/SalesOrderDetail.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/SalesOrderHeader.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/SalesOrderHeaderSalesReason.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/SalesPerson.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/SalesPersonQuotaHistory.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/SalesReason.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/SalesTaxRate.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/SalesTerritory.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/SalesTerritoryHistory.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/ScrapReason.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/Shift.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/ShipMethod.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/ShoppingCartItem.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/SpecialOffer.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/SpecialOfferProduct.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/StateProvince.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/Store.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/TransactionHistory.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/TransactionHistoryArchive.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/UnitMeasure.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/Vendor.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/WorkOrder.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/AdventureWorks/WorkOrderRouting.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/Orders/Customer.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/Orders/Order.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/Orders/OrderLine.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/Orders/OrdersFixtureSeedBase.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/Models/Orders/Product.cs (100%) rename benchmark/{Shared => EF.Benchmarks.Shared}/ParamsSummaryColumn.cs (100%) rename benchmark/{EFCore.SqlServer.EF6.Benchmarks => EF6.SqlServer.Benchmarks}/ChangeTracker/DbSetOperationTests.cs (100%) rename benchmark/{EFCore.SqlServer.EF6.Benchmarks => EF6.SqlServer.Benchmarks}/ChangeTracker/FixupTests.cs (100%) rename benchmark/{EFCore.SqlServer.EF6.Benchmarks => EF6.SqlServer.Benchmarks}/ChangeTracker/SingleRunJobAttribute.cs (100%) rename benchmark/{EFCore.SqlServer.EF6.Benchmarks/EFCore.Benchmarks.SqlServer.EF6.csproj => EF6.SqlServer.Benchmarks/EF6.SqlServer.Benchmarks.csproj} (86%) rename benchmark/{EFCore.SqlServer.EF6.Benchmarks => EF6.SqlServer.Benchmarks}/Initialization/InitializationTests.cs (100%) rename benchmark/{EFCore.SqlServer.EF6.Benchmarks => EF6.SqlServer.Benchmarks}/Models/AdventureWorks/AdventureWorksContext.cs (100%) rename benchmark/{EFCore.SqlServer.EF6.Benchmarks => EF6.SqlServer.Benchmarks}/Models/AdventureWorks/AdventureWorksFixture.cs (74%) rename benchmark/{EFCore.SqlServer.EF6.Benchmarks => EF6.SqlServer.Benchmarks}/Models/Orders/OrdersContext.cs (100%) rename benchmark/{EFCore.SqlServer.EF6.Benchmarks => EF6.SqlServer.Benchmarks}/Models/Orders/OrdersFixture.cs (96%) rename benchmark/{EFCore.SqlServer.EF6.Benchmarks => EF6.SqlServer.Benchmarks}/Query/FuncletizationTests.cs (100%) rename benchmark/{EFCore.SqlServer.EF6.Benchmarks => EF6.SqlServer.Benchmarks}/Query/NavigationsQueryTests.cs (100%) rename benchmark/{EFCore.SqlServer.EF6.Benchmarks => EF6.SqlServer.Benchmarks}/Query/QueryCompilationTests.cs (100%) rename benchmark/{EFCore.SqlServer.EF6.Benchmarks => EF6.SqlServer.Benchmarks}/Query/RawSqlQueryTests.cs (100%) rename benchmark/{EFCore.SqlServer.EF6.Benchmarks => EF6.SqlServer.Benchmarks}/Query/SimpleQueryTests.cs (100%) rename benchmark/{EFCore.SqlServer.EF6.Benchmarks => EF6.SqlServer.Benchmarks/Support}/Extensions.cs (97%) create mode 100644 benchmark/EF6.SqlServer.Benchmarks/Support/Program.cs create mode 100644 benchmark/EF6.SqlServer.Benchmarks/Support/SqlServerBenchmarkEnvironment.cs rename benchmark/{EFCore.SqlServer.EF6.Benchmarks => EF6.SqlServer.Benchmarks}/UpdatePipeline/SimpleUpdatePipelineTests.cs (100%) create mode 100644 benchmark/EF6.SqlServer.Benchmarks/config.json rename benchmark/{Shared.EFCore => EFCore.Benchmarks}/ChangeTracker/DbSetOperationTests.cs (100%) rename benchmark/{Shared.EFCore => EFCore.Benchmarks}/ChangeTracker/FixupTests.cs (100%) create mode 100644 benchmark/EFCore.Benchmarks/EFCore.Benchmarks.csproj rename benchmark/{Shared.EFCore => EFCore.Benchmarks}/Extensions/Extensions.cs (100%) rename benchmark/{Shared.EFCore => EFCore.Benchmarks}/Initialization/ColdStartEnabledTests.cs (100%) rename benchmark/{Shared.EFCore => EFCore.Benchmarks}/Initialization/InitializationTests.cs (100%) rename benchmark/{Shared.EFCore => EFCore.Benchmarks}/Models/AdventureWorks/AdventureWorksContextBase.cs (100%) rename benchmark/{Shared.EFCore => EFCore.Benchmarks}/Models/Orders/OrdersContextBase.cs (100%) rename benchmark/{Shared.EFCore => EFCore.Benchmarks}/Models/Orders/OrdersFixtureBase.cs (100%) rename benchmark/{Shared.EFCore => EFCore.Benchmarks}/Query/FuncletizationTests.cs (100%) rename benchmark/{Shared.EFCore => EFCore.Benchmarks}/Query/NavigationsQueryTests.cs (100%) rename benchmark/{Shared.EFCore => EFCore.Benchmarks}/Query/QueryCompilationTests.cs (100%) rename benchmark/{Shared.EFCore => EFCore.Benchmarks}/Query/RawSqlQueryTests.cs (100%) rename benchmark/{Shared.EFCore => EFCore.Benchmarks}/Query/SimpleQueryTests.cs (100%) rename benchmark/{Shared.EFCore => EFCore.Benchmarks}/UpdatePipeline/SimpleUpdatePipelineTests.cs (100%) rename benchmark/EFCore.SqlServer.Benchmarks/Models/AdventureWorks/{AdventureWorksContext.cs => AdventureWorksSqlServerContext.cs} (78%) rename benchmark/EFCore.SqlServer.Benchmarks/Models/AdventureWorks/{AdventureWorksFixture.cs => AdventureWorksSqlServerFixture.cs} (61%) rename benchmark/EFCore.SqlServer.Benchmarks/Models/Orders/{OrdersContext.cs => OrdersSqlServerContext.cs} (79%) rename benchmark/EFCore.SqlServer.Benchmarks/Models/Orders/{OrdersFixture.cs => OrdersSqlServerFixture.cs} (60%) create mode 100644 benchmark/EFCore.SqlServer.Benchmarks/Support/Program.cs create mode 100644 benchmark/EFCore.SqlServer.Benchmarks/Support/SqlServerBenchmarkEnvironment.cs delete mode 100644 benchmark/EFCore.SqlServer.Benchmarks/config.json delete mode 100644 benchmark/EFCore.SqlServer.EF6.Benchmarks/config.json rename benchmark/EFCore.Sqlite.Benchmarks/Models/AdventureWorks/{AdventureWorksContext.cs => AdventureWorksSqliteContext.cs} (79%) rename benchmark/EFCore.Sqlite.Benchmarks/Models/AdventureWorks/{AdventureWorksFixture.cs => AdventureWorksSqliteFixture.cs} (80%) rename benchmark/EFCore.Sqlite.Benchmarks/Models/Orders/{OrdersContext.cs => OrdersSqliteContext.cs} (79%) rename benchmark/EFCore.Sqlite.Benchmarks/Models/Orders/{OrdersFixture.cs => OrdersSqliteFixture.cs} (67%) create mode 100644 benchmark/EFCore.Sqlite.Benchmarks/Support/Program.cs delete mode 100644 benchmark/EFCore.Sqlite.Benchmarks/config.json delete mode 100644 benchmark/Shared/BenchmarkEnvironment.cs delete mode 100644 benchmark/Shared/Program.cs diff --git a/EFCore.sln b/EFCore.sln index cbb769f95d..fefa331331 100644 --- a/EFCore.sln +++ b/EFCore.sln @@ -131,7 +131,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.SqlServer.Benchmarks EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Sqlite.Benchmarks", "benchmark\EFCore.Sqlite.Benchmarks\EFCore.Sqlite.Benchmarks.csproj", "{5A44F67E-517F-458D-B9C7-12A4DBBAD64A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Benchmarks.SqlServer.EF6", "benchmark\EFCore.SqlServer.EF6.Benchmarks\EFCore.Benchmarks.SqlServer.EF6.csproj", "{678AB38D-B27C-4690-A3F9-2D2488391658}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EF6.SqlServer.Benchmarks", "benchmark\EF6.SqlServer.Benchmarks\EF6.SqlServer.Benchmarks.csproj", "{678AB38D-B27C-4690-A3F9-2D2488391658}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EFCore.Benchmarks", "benchmark\EFCore.Benchmarks\EFCore.Benchmarks.csproj", "{2642F4F0-69BE-4C43-94B7-B298FEC87D89}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EF.Benchmarks.Shared", "benchmark\EF.Benchmarks.Shared\EF.Benchmarks.Shared.csproj", "{BFC26566-4C6D-4904-A559-8FFE09369901}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -355,6 +359,14 @@ Global {678AB38D-B27C-4690-A3F9-2D2488391658}.Debug|Any CPU.Build.0 = Debug|Any CPU {678AB38D-B27C-4690-A3F9-2D2488391658}.Release|Any CPU.ActiveCfg = Release|Any CPU {678AB38D-B27C-4690-A3F9-2D2488391658}.Release|Any CPU.Build.0 = Release|Any CPU + {2642F4F0-69BE-4C43-94B7-B298FEC87D89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2642F4F0-69BE-4C43-94B7-B298FEC87D89}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2642F4F0-69BE-4C43-94B7-B298FEC87D89}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2642F4F0-69BE-4C43-94B7-B298FEC87D89}.Release|Any CPU.Build.0 = Release|Any CPU + {BFC26566-4C6D-4904-A559-8FFE09369901}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BFC26566-4C6D-4904-A559-8FFE09369901}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BFC26566-4C6D-4904-A559-8FFE09369901}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BFC26566-4C6D-4904-A559-8FFE09369901}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -414,6 +426,8 @@ Global {24D7B6D5-A22A-4734-BB55-F464C112F891} = {293B4F79-3CB9-402A-A74C-B8108C41A7CF} {5A44F67E-517F-458D-B9C7-12A4DBBAD64A} = {293B4F79-3CB9-402A-A74C-B8108C41A7CF} {678AB38D-B27C-4690-A3F9-2D2488391658} = {293B4F79-3CB9-402A-A74C-B8108C41A7CF} + {2642F4F0-69BE-4C43-94B7-B298FEC87D89} = {293B4F79-3CB9-402A-A74C-B8108C41A7CF} + {BFC26566-4C6D-4904-A559-8FFE09369901} = {293B4F79-3CB9-402A-A74C-B8108C41A7CF} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {285A5EB4-BCF4-40EB-B9E1-DF6DBCB5E705} diff --git a/benchmark/EF.Benchmarks.Shared/EF.Benchmarks.Shared.csproj b/benchmark/EF.Benchmarks.Shared/EF.Benchmarks.Shared.csproj new file mode 100644 index 0000000000..c599a74374 --- /dev/null +++ b/benchmark/EF.Benchmarks.Shared/EF.Benchmarks.Shared.csproj @@ -0,0 +1,12 @@ + + + + net461;netstandard2.0 + Microsoft.EntityFrameworkCore.Benchmarks + + + + true + + + diff --git a/benchmark/EF.Benchmarks.Shared/EFCoreBenchmarkRunner.cs b/benchmark/EF.Benchmarks.Shared/EFCoreBenchmarkRunner.cs new file mode 100644 index 0000000000..86170ed537 --- /dev/null +++ b/benchmark/EF.Benchmarks.Shared/EFCoreBenchmarkRunner.cs @@ -0,0 +1,54 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Linq; +using System.Reflection; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Columns; +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Diagnosers; +using BenchmarkDotNet.Exporters; +using BenchmarkDotNet.Exporters.Csv; +using BenchmarkDotNet.Horology; +using BenchmarkDotNet.Reports; +using BenchmarkDotNet.Running; + +namespace Microsoft.EntityFrameworkCore.Benchmarks +{ + public static class EFCoreBenchmarkRunner + { + public static void Run(string[] args, Assembly assembly, IConfig config = null) + { + if (config == null) + { + config = DefaultConfig.Instance; + } + + config = config.With(DefaultConfig.Instance.GetDiagnosers().Concat(new[] { MemoryDiagnoser.Default }).ToArray()); + + var index = Array.FindIndex(args, s => s == "--perflab"); + if (index >= 0) + { + var argList = args.ToList(); + argList.RemoveAt(index); + args = argList.ToArray(); + + config = config + .With(StatisticColumn.OperationsPerSecond, new ParamsSummaryColumn()) + .With( + MarkdownExporter.GitHub, new CsvExporter( + CsvSeparator.Comma, + new SummaryStyle + { + PrintUnitsInHeader = true, + PrintUnitsInContent = false, + TimeUnit = TimeUnit.Microsecond, + SizeUnit = SizeUnit.KB + })); + } + + BenchmarkSwitcher.FromAssembly(assembly).Run(args, config); + } + } +} diff --git a/benchmark/Shared/Initialization/ColdStartSandbox.cs b/benchmark/EF.Benchmarks.Shared/Initialization/ColdStartSandbox.cs similarity index 100% rename from benchmark/Shared/Initialization/ColdStartSandbox.cs rename to benchmark/EF.Benchmarks.Shared/Initialization/ColdStartSandbox.cs diff --git a/benchmark/Shared/Models/AdventureWorks/Address.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Address.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/Address.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Address.cs diff --git a/benchmark/Shared/Models/AdventureWorks/AddressType.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/AddressType.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/AddressType.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/AddressType.cs diff --git a/benchmark/Shared/Models/AdventureWorks/BillOfMaterials.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/BillOfMaterials.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/BillOfMaterials.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/BillOfMaterials.cs diff --git a/benchmark/Shared/Models/AdventureWorks/BusinessEntity.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/BusinessEntity.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/BusinessEntity.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/BusinessEntity.cs diff --git a/benchmark/Shared/Models/AdventureWorks/BusinessEntityAddress.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/BusinessEntityAddress.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/BusinessEntityAddress.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/BusinessEntityAddress.cs diff --git a/benchmark/Shared/Models/AdventureWorks/BusinessEntityContact.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/BusinessEntityContact.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/BusinessEntityContact.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/BusinessEntityContact.cs diff --git a/benchmark/Shared/Models/AdventureWorks/ContactType.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ContactType.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/ContactType.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ContactType.cs diff --git a/benchmark/Shared/Models/AdventureWorks/CountryRegion.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/CountryRegion.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/CountryRegion.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/CountryRegion.cs diff --git a/benchmark/Shared/Models/AdventureWorks/CountryRegionCurrency.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/CountryRegionCurrency.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/CountryRegionCurrency.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/CountryRegionCurrency.cs diff --git a/benchmark/Shared/Models/AdventureWorks/CreditCard.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/CreditCard.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/CreditCard.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/CreditCard.cs diff --git a/benchmark/Shared/Models/AdventureWorks/Culture.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Culture.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/Culture.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Culture.cs diff --git a/benchmark/Shared/Models/AdventureWorks/Currency.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Currency.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/Currency.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Currency.cs diff --git a/benchmark/Shared/Models/AdventureWorks/CurrencyRate.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/CurrencyRate.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/CurrencyRate.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/CurrencyRate.cs diff --git a/benchmark/Shared/Models/AdventureWorks/Customer.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Customer.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/Customer.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Customer.cs diff --git a/benchmark/Shared/Models/AdventureWorks/Department.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Department.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/Department.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Department.cs diff --git a/benchmark/Shared/Models/AdventureWorks/EmailAddress.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/EmailAddress.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/EmailAddress.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/EmailAddress.cs diff --git a/benchmark/Shared/Models/AdventureWorks/Employee.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Employee.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/Employee.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Employee.cs diff --git a/benchmark/Shared/Models/AdventureWorks/EmployeeDepartmentHistory.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/EmployeeDepartmentHistory.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/EmployeeDepartmentHistory.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/EmployeeDepartmentHistory.cs diff --git a/benchmark/Shared/Models/AdventureWorks/EmployeePayHistory.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/EmployeePayHistory.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/EmployeePayHistory.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/EmployeePayHistory.cs diff --git a/benchmark/Shared/Models/AdventureWorks/Illustration.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Illustration.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/Illustration.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Illustration.cs diff --git a/benchmark/Shared/Models/AdventureWorks/JobCandidate.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/JobCandidate.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/JobCandidate.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/JobCandidate.cs diff --git a/benchmark/Shared/Models/AdventureWorks/Location.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Location.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/Location.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Location.cs diff --git a/benchmark/Shared/Models/AdventureWorks/Password.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Password.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/Password.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Password.cs diff --git a/benchmark/Shared/Models/AdventureWorks/Person.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Person.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/Person.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Person.cs diff --git a/benchmark/Shared/Models/AdventureWorks/PersonCreditCard.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/PersonCreditCard.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/PersonCreditCard.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/PersonCreditCard.cs diff --git a/benchmark/Shared/Models/AdventureWorks/PersonPhone.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/PersonPhone.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/PersonPhone.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/PersonPhone.cs diff --git a/benchmark/Shared/Models/AdventureWorks/PhoneNumberType.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/PhoneNumberType.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/PhoneNumberType.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/PhoneNumberType.cs diff --git a/benchmark/Shared/Models/AdventureWorks/Product.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Product.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/Product.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Product.cs diff --git a/benchmark/Shared/Models/AdventureWorks/ProductCategory.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductCategory.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/ProductCategory.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductCategory.cs diff --git a/benchmark/Shared/Models/AdventureWorks/ProductCostHistory.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductCostHistory.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/ProductCostHistory.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductCostHistory.cs diff --git a/benchmark/Shared/Models/AdventureWorks/ProductDescription.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductDescription.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/ProductDescription.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductDescription.cs diff --git a/benchmark/Shared/Models/AdventureWorks/ProductDocument.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductDocument.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/ProductDocument.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductDocument.cs diff --git a/benchmark/Shared/Models/AdventureWorks/ProductInventory.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductInventory.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/ProductInventory.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductInventory.cs diff --git a/benchmark/Shared/Models/AdventureWorks/ProductListPriceHistory.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductListPriceHistory.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/ProductListPriceHistory.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductListPriceHistory.cs diff --git a/benchmark/Shared/Models/AdventureWorks/ProductModel.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductModel.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/ProductModel.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductModel.cs diff --git a/benchmark/Shared/Models/AdventureWorks/ProductModelIllustration.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductModelIllustration.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/ProductModelIllustration.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductModelIllustration.cs diff --git a/benchmark/Shared/Models/AdventureWorks/ProductModelProductDescriptionCulture.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductModelProductDescriptionCulture.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/ProductModelProductDescriptionCulture.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductModelProductDescriptionCulture.cs diff --git a/benchmark/Shared/Models/AdventureWorks/ProductPhoto.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductPhoto.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/ProductPhoto.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductPhoto.cs diff --git a/benchmark/Shared/Models/AdventureWorks/ProductProductPhoto.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductProductPhoto.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/ProductProductPhoto.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductProductPhoto.cs diff --git a/benchmark/Shared/Models/AdventureWorks/ProductReview.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductReview.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/ProductReview.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductReview.cs diff --git a/benchmark/Shared/Models/AdventureWorks/ProductSubcategory.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductSubcategory.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/ProductSubcategory.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductSubcategory.cs diff --git a/benchmark/Shared/Models/AdventureWorks/ProductVendor.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductVendor.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/ProductVendor.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ProductVendor.cs diff --git a/benchmark/Shared/Models/AdventureWorks/PurchaseOrderDetail.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/PurchaseOrderDetail.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/PurchaseOrderDetail.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/PurchaseOrderDetail.cs diff --git a/benchmark/Shared/Models/AdventureWorks/PurchaseOrderHeader.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/PurchaseOrderHeader.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/PurchaseOrderHeader.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/PurchaseOrderHeader.cs diff --git a/benchmark/Shared/Models/AdventureWorks/SalesOrderDetail.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SalesOrderDetail.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/SalesOrderDetail.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SalesOrderDetail.cs diff --git a/benchmark/Shared/Models/AdventureWorks/SalesOrderHeader.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SalesOrderHeader.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/SalesOrderHeader.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SalesOrderHeader.cs diff --git a/benchmark/Shared/Models/AdventureWorks/SalesOrderHeaderSalesReason.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SalesOrderHeaderSalesReason.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/SalesOrderHeaderSalesReason.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SalesOrderHeaderSalesReason.cs diff --git a/benchmark/Shared/Models/AdventureWorks/SalesPerson.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SalesPerson.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/SalesPerson.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SalesPerson.cs diff --git a/benchmark/Shared/Models/AdventureWorks/SalesPersonQuotaHistory.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SalesPersonQuotaHistory.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/SalesPersonQuotaHistory.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SalesPersonQuotaHistory.cs diff --git a/benchmark/Shared/Models/AdventureWorks/SalesReason.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SalesReason.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/SalesReason.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SalesReason.cs diff --git a/benchmark/Shared/Models/AdventureWorks/SalesTaxRate.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SalesTaxRate.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/SalesTaxRate.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SalesTaxRate.cs diff --git a/benchmark/Shared/Models/AdventureWorks/SalesTerritory.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SalesTerritory.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/SalesTerritory.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SalesTerritory.cs diff --git a/benchmark/Shared/Models/AdventureWorks/SalesTerritoryHistory.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SalesTerritoryHistory.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/SalesTerritoryHistory.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SalesTerritoryHistory.cs diff --git a/benchmark/Shared/Models/AdventureWorks/ScrapReason.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ScrapReason.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/ScrapReason.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ScrapReason.cs diff --git a/benchmark/Shared/Models/AdventureWorks/Shift.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Shift.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/Shift.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Shift.cs diff --git a/benchmark/Shared/Models/AdventureWorks/ShipMethod.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ShipMethod.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/ShipMethod.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ShipMethod.cs diff --git a/benchmark/Shared/Models/AdventureWorks/ShoppingCartItem.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ShoppingCartItem.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/ShoppingCartItem.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/ShoppingCartItem.cs diff --git a/benchmark/Shared/Models/AdventureWorks/SpecialOffer.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SpecialOffer.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/SpecialOffer.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SpecialOffer.cs diff --git a/benchmark/Shared/Models/AdventureWorks/SpecialOfferProduct.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SpecialOfferProduct.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/SpecialOfferProduct.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/SpecialOfferProduct.cs diff --git a/benchmark/Shared/Models/AdventureWorks/StateProvince.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/StateProvince.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/StateProvince.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/StateProvince.cs diff --git a/benchmark/Shared/Models/AdventureWorks/Store.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Store.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/Store.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Store.cs diff --git a/benchmark/Shared/Models/AdventureWorks/TransactionHistory.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/TransactionHistory.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/TransactionHistory.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/TransactionHistory.cs diff --git a/benchmark/Shared/Models/AdventureWorks/TransactionHistoryArchive.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/TransactionHistoryArchive.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/TransactionHistoryArchive.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/TransactionHistoryArchive.cs diff --git a/benchmark/Shared/Models/AdventureWorks/UnitMeasure.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/UnitMeasure.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/UnitMeasure.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/UnitMeasure.cs diff --git a/benchmark/Shared/Models/AdventureWorks/Vendor.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Vendor.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/Vendor.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/Vendor.cs diff --git a/benchmark/Shared/Models/AdventureWorks/WorkOrder.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/WorkOrder.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/WorkOrder.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/WorkOrder.cs diff --git a/benchmark/Shared/Models/AdventureWorks/WorkOrderRouting.cs b/benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/WorkOrderRouting.cs similarity index 100% rename from benchmark/Shared/Models/AdventureWorks/WorkOrderRouting.cs rename to benchmark/EF.Benchmarks.Shared/Models/AdventureWorks/WorkOrderRouting.cs diff --git a/benchmark/Shared/Models/Orders/Customer.cs b/benchmark/EF.Benchmarks.Shared/Models/Orders/Customer.cs similarity index 100% rename from benchmark/Shared/Models/Orders/Customer.cs rename to benchmark/EF.Benchmarks.Shared/Models/Orders/Customer.cs diff --git a/benchmark/Shared/Models/Orders/Order.cs b/benchmark/EF.Benchmarks.Shared/Models/Orders/Order.cs similarity index 100% rename from benchmark/Shared/Models/Orders/Order.cs rename to benchmark/EF.Benchmarks.Shared/Models/Orders/Order.cs diff --git a/benchmark/Shared/Models/Orders/OrderLine.cs b/benchmark/EF.Benchmarks.Shared/Models/Orders/OrderLine.cs similarity index 100% rename from benchmark/Shared/Models/Orders/OrderLine.cs rename to benchmark/EF.Benchmarks.Shared/Models/Orders/OrderLine.cs diff --git a/benchmark/Shared/Models/Orders/OrdersFixtureSeedBase.cs b/benchmark/EF.Benchmarks.Shared/Models/Orders/OrdersFixtureSeedBase.cs similarity index 100% rename from benchmark/Shared/Models/Orders/OrdersFixtureSeedBase.cs rename to benchmark/EF.Benchmarks.Shared/Models/Orders/OrdersFixtureSeedBase.cs diff --git a/benchmark/Shared/Models/Orders/Product.cs b/benchmark/EF.Benchmarks.Shared/Models/Orders/Product.cs similarity index 100% rename from benchmark/Shared/Models/Orders/Product.cs rename to benchmark/EF.Benchmarks.Shared/Models/Orders/Product.cs diff --git a/benchmark/Shared/ParamsSummaryColumn.cs b/benchmark/EF.Benchmarks.Shared/ParamsSummaryColumn.cs similarity index 100% rename from benchmark/Shared/ParamsSummaryColumn.cs rename to benchmark/EF.Benchmarks.Shared/ParamsSummaryColumn.cs diff --git a/benchmark/EFCore.SqlServer.EF6.Benchmarks/ChangeTracker/DbSetOperationTests.cs b/benchmark/EF6.SqlServer.Benchmarks/ChangeTracker/DbSetOperationTests.cs similarity index 100% rename from benchmark/EFCore.SqlServer.EF6.Benchmarks/ChangeTracker/DbSetOperationTests.cs rename to benchmark/EF6.SqlServer.Benchmarks/ChangeTracker/DbSetOperationTests.cs diff --git a/benchmark/EFCore.SqlServer.EF6.Benchmarks/ChangeTracker/FixupTests.cs b/benchmark/EF6.SqlServer.Benchmarks/ChangeTracker/FixupTests.cs similarity index 100% rename from benchmark/EFCore.SqlServer.EF6.Benchmarks/ChangeTracker/FixupTests.cs rename to benchmark/EF6.SqlServer.Benchmarks/ChangeTracker/FixupTests.cs diff --git a/benchmark/EFCore.SqlServer.EF6.Benchmarks/ChangeTracker/SingleRunJobAttribute.cs b/benchmark/EF6.SqlServer.Benchmarks/ChangeTracker/SingleRunJobAttribute.cs similarity index 100% rename from benchmark/EFCore.SqlServer.EF6.Benchmarks/ChangeTracker/SingleRunJobAttribute.cs rename to benchmark/EF6.SqlServer.Benchmarks/ChangeTracker/SingleRunJobAttribute.cs diff --git a/benchmark/EFCore.SqlServer.EF6.Benchmarks/EFCore.Benchmarks.SqlServer.EF6.csproj b/benchmark/EF6.SqlServer.Benchmarks/EF6.SqlServer.Benchmarks.csproj similarity index 86% rename from benchmark/EFCore.SqlServer.EF6.Benchmarks/EFCore.Benchmarks.SqlServer.EF6.csproj rename to benchmark/EF6.SqlServer.Benchmarks/EF6.SqlServer.Benchmarks.csproj index a7c7d6f886..012a4e6386 100644 --- a/benchmark/EFCore.SqlServer.EF6.Benchmarks/EFCore.Benchmarks.SqlServer.EF6.csproj +++ b/benchmark/EF6.SqlServer.Benchmarks/EF6.SqlServer.Benchmarks.csproj @@ -18,7 +18,7 @@ - + diff --git a/benchmark/EFCore.SqlServer.EF6.Benchmarks/Initialization/InitializationTests.cs b/benchmark/EF6.SqlServer.Benchmarks/Initialization/InitializationTests.cs similarity index 100% rename from benchmark/EFCore.SqlServer.EF6.Benchmarks/Initialization/InitializationTests.cs rename to benchmark/EF6.SqlServer.Benchmarks/Initialization/InitializationTests.cs diff --git a/benchmark/EFCore.SqlServer.EF6.Benchmarks/Models/AdventureWorks/AdventureWorksContext.cs b/benchmark/EF6.SqlServer.Benchmarks/Models/AdventureWorks/AdventureWorksContext.cs similarity index 100% rename from benchmark/EFCore.SqlServer.EF6.Benchmarks/Models/AdventureWorks/AdventureWorksContext.cs rename to benchmark/EF6.SqlServer.Benchmarks/Models/AdventureWorks/AdventureWorksContext.cs diff --git a/benchmark/EFCore.SqlServer.EF6.Benchmarks/Models/AdventureWorks/AdventureWorksFixture.cs b/benchmark/EF6.SqlServer.Benchmarks/Models/AdventureWorks/AdventureWorksFixture.cs similarity index 74% rename from benchmark/EFCore.SqlServer.EF6.Benchmarks/Models/AdventureWorks/AdventureWorksFixture.cs rename to benchmark/EF6.SqlServer.Benchmarks/Models/AdventureWorks/AdventureWorksFixture.cs index 00470b4e39..8b5fbe52c4 100644 --- a/benchmark/EFCore.SqlServer.EF6.Benchmarks/Models/AdventureWorks/AdventureWorksFixture.cs +++ b/benchmark/EF6.SqlServer.Benchmarks/Models/AdventureWorks/AdventureWorksFixture.cs @@ -1,11 +1,13 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using Microsoft.EntityFrameworkCore.Benchmarks; + namespace Microsoft.EntityFrameworkCore.Benchmarks.Models.AdventureWorks { public static class AdventureWorksFixture { - public static string ConnectionString { get; } = $"{BenchmarkEnvironment.Instance.BenchmarkDatabase}Database=AdventureWorks2014;"; + public static readonly string ConnectionString = SqlServerBenchmarkEnvironment.CreateConnectionString("AdventureWorks2014"); // This method is called from timed code, be careful when changing it public static AdventureWorksContext CreateContext() diff --git a/benchmark/EFCore.SqlServer.EF6.Benchmarks/Models/Orders/OrdersContext.cs b/benchmark/EF6.SqlServer.Benchmarks/Models/Orders/OrdersContext.cs similarity index 100% rename from benchmark/EFCore.SqlServer.EF6.Benchmarks/Models/Orders/OrdersContext.cs rename to benchmark/EF6.SqlServer.Benchmarks/Models/Orders/OrdersContext.cs diff --git a/benchmark/EFCore.SqlServer.EF6.Benchmarks/Models/Orders/OrdersFixture.cs b/benchmark/EF6.SqlServer.Benchmarks/Models/Orders/OrdersFixture.cs similarity index 96% rename from benchmark/EFCore.SqlServer.EF6.Benchmarks/Models/Orders/OrdersFixture.cs rename to benchmark/EF6.SqlServer.Benchmarks/Models/Orders/OrdersFixture.cs index ced9752ca1..bbb54b0656 100644 --- a/benchmark/EFCore.SqlServer.EF6.Benchmarks/Models/Orders/OrdersFixture.cs +++ b/benchmark/EF6.SqlServer.Benchmarks/Models/Orders/OrdersFixture.cs @@ -19,7 +19,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.Models.Orders public OrdersFixture(string databaseName, int productCount, int customerCount, int ordersPerCustomer, int linesPerOrder, Action seedAction = null) { - _connectionString = $"{BenchmarkEnvironment.Instance.BenchmarkDatabase}Database={databaseName};"; + _connectionString = SqlServerBenchmarkEnvironment.CreateConnectionString(databaseName); _productCount = productCount; _customerCount = customerCount; _ordersPerCustomer = ordersPerCustomer; diff --git a/benchmark/EFCore.SqlServer.EF6.Benchmarks/Query/FuncletizationTests.cs b/benchmark/EF6.SqlServer.Benchmarks/Query/FuncletizationTests.cs similarity index 100% rename from benchmark/EFCore.SqlServer.EF6.Benchmarks/Query/FuncletizationTests.cs rename to benchmark/EF6.SqlServer.Benchmarks/Query/FuncletizationTests.cs diff --git a/benchmark/EFCore.SqlServer.EF6.Benchmarks/Query/NavigationsQueryTests.cs b/benchmark/EF6.SqlServer.Benchmarks/Query/NavigationsQueryTests.cs similarity index 100% rename from benchmark/EFCore.SqlServer.EF6.Benchmarks/Query/NavigationsQueryTests.cs rename to benchmark/EF6.SqlServer.Benchmarks/Query/NavigationsQueryTests.cs diff --git a/benchmark/EFCore.SqlServer.EF6.Benchmarks/Query/QueryCompilationTests.cs b/benchmark/EF6.SqlServer.Benchmarks/Query/QueryCompilationTests.cs similarity index 100% rename from benchmark/EFCore.SqlServer.EF6.Benchmarks/Query/QueryCompilationTests.cs rename to benchmark/EF6.SqlServer.Benchmarks/Query/QueryCompilationTests.cs diff --git a/benchmark/EFCore.SqlServer.EF6.Benchmarks/Query/RawSqlQueryTests.cs b/benchmark/EF6.SqlServer.Benchmarks/Query/RawSqlQueryTests.cs similarity index 100% rename from benchmark/EFCore.SqlServer.EF6.Benchmarks/Query/RawSqlQueryTests.cs rename to benchmark/EF6.SqlServer.Benchmarks/Query/RawSqlQueryTests.cs diff --git a/benchmark/EFCore.SqlServer.EF6.Benchmarks/Query/SimpleQueryTests.cs b/benchmark/EF6.SqlServer.Benchmarks/Query/SimpleQueryTests.cs similarity index 100% rename from benchmark/EFCore.SqlServer.EF6.Benchmarks/Query/SimpleQueryTests.cs rename to benchmark/EF6.SqlServer.Benchmarks/Query/SimpleQueryTests.cs diff --git a/benchmark/EFCore.SqlServer.EF6.Benchmarks/Extensions.cs b/benchmark/EF6.SqlServer.Benchmarks/Support/Extensions.cs similarity index 97% rename from benchmark/EFCore.SqlServer.EF6.Benchmarks/Extensions.cs rename to benchmark/EF6.SqlServer.Benchmarks/Support/Extensions.cs index 47d8e687d8..726299d40a 100644 --- a/benchmark/EFCore.SqlServer.EF6.Benchmarks/Extensions.cs +++ b/benchmark/EF6.SqlServer.Benchmarks/Support/Extensions.cs @@ -10,6 +10,7 @@ using System.Reflection; // ReSharper disable PossibleNullReferenceException +// ReSharper disable once CheckNamespace namespace Microsoft.EntityFrameworkCore.Benchmarks { public static class Extensions diff --git a/benchmark/EF6.SqlServer.Benchmarks/Support/Program.cs b/benchmark/EF6.SqlServer.Benchmarks/Support/Program.cs new file mode 100644 index 0000000000..6c209d3444 --- /dev/null +++ b/benchmark/EF6.SqlServer.Benchmarks/Support/Program.cs @@ -0,0 +1,23 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Linq; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Columns; +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Diagnosers; +using BenchmarkDotNet.Exporters; +using BenchmarkDotNet.Exporters.Csv; +using BenchmarkDotNet.Horology; +using BenchmarkDotNet.Reports; +using BenchmarkDotNet.Running; + +// ReSharper disable once CheckNamespace +namespace Microsoft.EntityFrameworkCore.Benchmarks +{ + public class Program + { + private static void Main(string[] args) => EFCoreBenchmarkRunner.Run(args, typeof(Program).Assembly); + } +} diff --git a/benchmark/EF6.SqlServer.Benchmarks/Support/SqlServerBenchmarkEnvironment.cs b/benchmark/EF6.SqlServer.Benchmarks/Support/SqlServerBenchmarkEnvironment.cs new file mode 100644 index 0000000000..191dfb4f5b --- /dev/null +++ b/benchmark/EF6.SqlServer.Benchmarks/Support/SqlServerBenchmarkEnvironment.cs @@ -0,0 +1,34 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.IO; +using System.Data.SqlClient; +using Microsoft.Extensions.Configuration; + +// ReSharper disable once CheckNamespace +namespace Microsoft.EntityFrameworkCore.Benchmarks +{ + public static class SqlServerBenchmarkEnvironment + { + public static IConfiguration Config { get; } + + static SqlServerBenchmarkEnvironment() + { + var configBuilder = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("config.json", optional: true) + .AddEnvironmentVariables(); + + Config = configBuilder.Build() + .GetSection("Test:SqlServer"); + } + + private const string DefaultConnectionString + = "Data Source=(localdb)\\MSSQLLocalDB;Database=master;Integrated Security=True;Connect Timeout=30;ConnectRetryCount=0"; + + public static string DefaultConnection => Config["DefaultConnection"] ?? DefaultConnectionString; + + public static string CreateConnectionString(string name, string fileName = null, bool? multipleActiveResultSets = null) + => new SqlConnectionStringBuilder(DefaultConnection) { InitialCatalog = name }.ToString(); + } +} diff --git a/benchmark/EFCore.SqlServer.EF6.Benchmarks/UpdatePipeline/SimpleUpdatePipelineTests.cs b/benchmark/EF6.SqlServer.Benchmarks/UpdatePipeline/SimpleUpdatePipelineTests.cs similarity index 100% rename from benchmark/EFCore.SqlServer.EF6.Benchmarks/UpdatePipeline/SimpleUpdatePipelineTests.cs rename to benchmark/EF6.SqlServer.Benchmarks/UpdatePipeline/SimpleUpdatePipelineTests.cs diff --git a/benchmark/EF6.SqlServer.Benchmarks/config.json b/benchmark/EF6.SqlServer.Benchmarks/config.json new file mode 100644 index 0000000000..7e2647178f --- /dev/null +++ b/benchmark/EF6.SqlServer.Benchmarks/config.json @@ -0,0 +1,5 @@ +{ + "benchmarks": { + "benchmarkDatabase": "Server=(localdb)\\mssqllocaldb;Trusted_Connection=True;MultipleActiveResultSets=true;" + } +} diff --git a/benchmark/Shared.EFCore/ChangeTracker/DbSetOperationTests.cs b/benchmark/EFCore.Benchmarks/ChangeTracker/DbSetOperationTests.cs similarity index 100% rename from benchmark/Shared.EFCore/ChangeTracker/DbSetOperationTests.cs rename to benchmark/EFCore.Benchmarks/ChangeTracker/DbSetOperationTests.cs diff --git a/benchmark/Shared.EFCore/ChangeTracker/FixupTests.cs b/benchmark/EFCore.Benchmarks/ChangeTracker/FixupTests.cs similarity index 100% rename from benchmark/Shared.EFCore/ChangeTracker/FixupTests.cs rename to benchmark/EFCore.Benchmarks/ChangeTracker/FixupTests.cs diff --git a/benchmark/EFCore.Benchmarks/EFCore.Benchmarks.csproj b/benchmark/EFCore.Benchmarks/EFCore.Benchmarks.csproj new file mode 100644 index 0000000000..7ff94a891f --- /dev/null +++ b/benchmark/EFCore.Benchmarks/EFCore.Benchmarks.csproj @@ -0,0 +1,37 @@ + + + + net461;netcoreapp2.0;netcoreapp2.1;netcoreapp2.2;netcoreapp3.0 + netcoreapp3.0 + Microsoft.EntityFrameworkCore.Benchmarks + + + + true + + + + + + + + + + + + + + + + + + + + + + + + $(DefineConstants);OLD_FROM_SQL + + + diff --git a/benchmark/Shared.EFCore/Extensions/Extensions.cs b/benchmark/EFCore.Benchmarks/Extensions/Extensions.cs similarity index 100% rename from benchmark/Shared.EFCore/Extensions/Extensions.cs rename to benchmark/EFCore.Benchmarks/Extensions/Extensions.cs diff --git a/benchmark/Shared.EFCore/Initialization/ColdStartEnabledTests.cs b/benchmark/EFCore.Benchmarks/Initialization/ColdStartEnabledTests.cs similarity index 100% rename from benchmark/Shared.EFCore/Initialization/ColdStartEnabledTests.cs rename to benchmark/EFCore.Benchmarks/Initialization/ColdStartEnabledTests.cs diff --git a/benchmark/Shared.EFCore/Initialization/InitializationTests.cs b/benchmark/EFCore.Benchmarks/Initialization/InitializationTests.cs similarity index 100% rename from benchmark/Shared.EFCore/Initialization/InitializationTests.cs rename to benchmark/EFCore.Benchmarks/Initialization/InitializationTests.cs diff --git a/benchmark/Shared.EFCore/Models/AdventureWorks/AdventureWorksContextBase.cs b/benchmark/EFCore.Benchmarks/Models/AdventureWorks/AdventureWorksContextBase.cs similarity index 100% rename from benchmark/Shared.EFCore/Models/AdventureWorks/AdventureWorksContextBase.cs rename to benchmark/EFCore.Benchmarks/Models/AdventureWorks/AdventureWorksContextBase.cs diff --git a/benchmark/Shared.EFCore/Models/Orders/OrdersContextBase.cs b/benchmark/EFCore.Benchmarks/Models/Orders/OrdersContextBase.cs similarity index 100% rename from benchmark/Shared.EFCore/Models/Orders/OrdersContextBase.cs rename to benchmark/EFCore.Benchmarks/Models/Orders/OrdersContextBase.cs diff --git a/benchmark/Shared.EFCore/Models/Orders/OrdersFixtureBase.cs b/benchmark/EFCore.Benchmarks/Models/Orders/OrdersFixtureBase.cs similarity index 100% rename from benchmark/Shared.EFCore/Models/Orders/OrdersFixtureBase.cs rename to benchmark/EFCore.Benchmarks/Models/Orders/OrdersFixtureBase.cs diff --git a/benchmark/Shared.EFCore/Query/FuncletizationTests.cs b/benchmark/EFCore.Benchmarks/Query/FuncletizationTests.cs similarity index 100% rename from benchmark/Shared.EFCore/Query/FuncletizationTests.cs rename to benchmark/EFCore.Benchmarks/Query/FuncletizationTests.cs diff --git a/benchmark/Shared.EFCore/Query/NavigationsQueryTests.cs b/benchmark/EFCore.Benchmarks/Query/NavigationsQueryTests.cs similarity index 100% rename from benchmark/Shared.EFCore/Query/NavigationsQueryTests.cs rename to benchmark/EFCore.Benchmarks/Query/NavigationsQueryTests.cs diff --git a/benchmark/Shared.EFCore/Query/QueryCompilationTests.cs b/benchmark/EFCore.Benchmarks/Query/QueryCompilationTests.cs similarity index 100% rename from benchmark/Shared.EFCore/Query/QueryCompilationTests.cs rename to benchmark/EFCore.Benchmarks/Query/QueryCompilationTests.cs diff --git a/benchmark/Shared.EFCore/Query/RawSqlQueryTests.cs b/benchmark/EFCore.Benchmarks/Query/RawSqlQueryTests.cs similarity index 100% rename from benchmark/Shared.EFCore/Query/RawSqlQueryTests.cs rename to benchmark/EFCore.Benchmarks/Query/RawSqlQueryTests.cs diff --git a/benchmark/Shared.EFCore/Query/SimpleQueryTests.cs b/benchmark/EFCore.Benchmarks/Query/SimpleQueryTests.cs similarity index 100% rename from benchmark/Shared.EFCore/Query/SimpleQueryTests.cs rename to benchmark/EFCore.Benchmarks/Query/SimpleQueryTests.cs diff --git a/benchmark/Shared.EFCore/UpdatePipeline/SimpleUpdatePipelineTests.cs b/benchmark/EFCore.Benchmarks/UpdatePipeline/SimpleUpdatePipelineTests.cs similarity index 100% rename from benchmark/Shared.EFCore/UpdatePipeline/SimpleUpdatePipelineTests.cs rename to benchmark/EFCore.Benchmarks/UpdatePipeline/SimpleUpdatePipelineTests.cs diff --git a/benchmark/EFCore.SqlServer.Benchmarks/ChangeTracker/DbSetOperationSqlServerTests.cs b/benchmark/EFCore.SqlServer.Benchmarks/ChangeTracker/DbSetOperationSqlServerTests.cs index 1de3edd193..80ed8ff19f 100644 --- a/benchmark/EFCore.SqlServer.Benchmarks/ChangeTracker/DbSetOperationSqlServerTests.cs +++ b/benchmark/EFCore.SqlServer.Benchmarks/ChangeTracker/DbSetOperationSqlServerTests.cs @@ -13,7 +13,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.ChangeTracker { public override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_ChangeTracker_DbSetOperation"); + return new OrdersSqlServerFixture("Perf_ChangeTracker_DbSetOperation"); } } @@ -21,7 +21,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.ChangeTracker { public override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_ChangeTracker_DbSetOperation"); + return new OrdersSqlServerFixture("Perf_ChangeTracker_DbSetOperation"); } } } diff --git a/benchmark/EFCore.SqlServer.Benchmarks/ChangeTracker/FixupSqlServerTests.cs b/benchmark/EFCore.SqlServer.Benchmarks/ChangeTracker/FixupSqlServerTests.cs index 24a1a05f4d..16fce3f638 100644 --- a/benchmark/EFCore.SqlServer.Benchmarks/ChangeTracker/FixupSqlServerTests.cs +++ b/benchmark/EFCore.SqlServer.Benchmarks/ChangeTracker/FixupSqlServerTests.cs @@ -13,7 +13,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.ChangeTracker { public override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_ChangeTracker_Fixup"); + return new OrdersSqlServerFixture("Perf_ChangeTracker_Fixup"); } } @@ -21,7 +21,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.ChangeTracker { public override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_ChangeTracker_Fixup"); + return new OrdersSqlServerFixture("Perf_ChangeTracker_Fixup"); } } } diff --git a/benchmark/EFCore.SqlServer.Benchmarks/EFCore.SqlServer.Benchmarks.csproj b/benchmark/EFCore.SqlServer.Benchmarks/EFCore.SqlServer.Benchmarks.csproj index b008823956..e620e72338 100644 --- a/benchmark/EFCore.SqlServer.Benchmarks/EFCore.SqlServer.Benchmarks.csproj +++ b/benchmark/EFCore.SqlServer.Benchmarks/EFCore.SqlServer.Benchmarks.csproj @@ -15,22 +15,18 @@ - + - + - + - - $(DefineConstants);OLD_FROM_SQL - - PreserveNewest @@ -39,8 +35,7 @@ - - + diff --git a/benchmark/EFCore.SqlServer.Benchmarks/Initialization/ColdStartEnabledSqlServerTest.cs b/benchmark/EFCore.SqlServer.Benchmarks/Initialization/ColdStartEnabledSqlServerTest.cs index 0b9cb3fc67..512fba6759 100644 --- a/benchmark/EFCore.SqlServer.Benchmarks/Initialization/ColdStartEnabledSqlServerTest.cs +++ b/benchmark/EFCore.SqlServer.Benchmarks/Initialization/ColdStartEnabledSqlServerTest.cs @@ -9,7 +9,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.Initialization { protected override AdventureWorksContextBase CreateContext() { - return AdventureWorksFixture.CreateContext(); + return AdventureWorksSqlServerFixture.CreateContext(); } } } diff --git a/benchmark/EFCore.SqlServer.Benchmarks/Models/AdventureWorks/AdventureWorksContext.cs b/benchmark/EFCore.SqlServer.Benchmarks/Models/AdventureWorks/AdventureWorksSqlServerContext.cs similarity index 78% rename from benchmark/EFCore.SqlServer.Benchmarks/Models/AdventureWorks/AdventureWorksContext.cs rename to benchmark/EFCore.SqlServer.Benchmarks/Models/AdventureWorks/AdventureWorksSqlServerContext.cs index 22460b367e..ed6b3f55a8 100644 --- a/benchmark/EFCore.SqlServer.Benchmarks/Models/AdventureWorks/AdventureWorksContext.cs +++ b/benchmark/EFCore.SqlServer.Benchmarks/Models/AdventureWorks/AdventureWorksSqlServerContext.cs @@ -4,11 +4,11 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.Models.AdventureWorks { - public class AdventureWorksContext : AdventureWorksContextBase + public class AdventureWorksSqlServerContext : AdventureWorksContextBase { private readonly string _connectionString; - public AdventureWorksContext(string connectionString) + public AdventureWorksSqlServerContext(string connectionString) { _connectionString = connectionString; } diff --git a/benchmark/EFCore.SqlServer.Benchmarks/Models/AdventureWorks/AdventureWorksFixture.cs b/benchmark/EFCore.SqlServer.Benchmarks/Models/AdventureWorks/AdventureWorksSqlServerFixture.cs similarity index 61% rename from benchmark/EFCore.SqlServer.Benchmarks/Models/AdventureWorks/AdventureWorksFixture.cs rename to benchmark/EFCore.SqlServer.Benchmarks/Models/AdventureWorks/AdventureWorksSqlServerFixture.cs index 66e00eb9d4..4211b399a8 100644 --- a/benchmark/EFCore.SqlServer.Benchmarks/Models/AdventureWorks/AdventureWorksFixture.cs +++ b/benchmark/EFCore.SqlServer.Benchmarks/Models/AdventureWorks/AdventureWorksSqlServerFixture.cs @@ -3,14 +3,14 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.Models.AdventureWorks { - public static class AdventureWorksFixture + public static class AdventureWorksSqlServerFixture { - private static readonly string _connectionString = $"{BenchmarkEnvironment.Instance.BenchmarkDatabase}Database=AdventureWorks2014;"; + private static readonly string _connectionString = SqlServerBenchmarkEnvironment.CreateConnectionString("AdventureWorks2014"); // This method is called from timed code, be careful when changing it public static AdventureWorksContextBase CreateContext() { - return new AdventureWorksContext(_connectionString); + return new AdventureWorksSqlServerContext(_connectionString); } } } diff --git a/benchmark/EFCore.SqlServer.Benchmarks/Models/Orders/OrdersContext.cs b/benchmark/EFCore.SqlServer.Benchmarks/Models/Orders/OrdersSqlServerContext.cs similarity index 79% rename from benchmark/EFCore.SqlServer.Benchmarks/Models/Orders/OrdersContext.cs rename to benchmark/EFCore.SqlServer.Benchmarks/Models/Orders/OrdersSqlServerContext.cs index 38c3923776..2698f9ae03 100644 --- a/benchmark/EFCore.SqlServer.Benchmarks/Models/Orders/OrdersContext.cs +++ b/benchmark/EFCore.SqlServer.Benchmarks/Models/Orders/OrdersSqlServerContext.cs @@ -6,12 +6,12 @@ using System; namespace Microsoft.EntityFrameworkCore.Benchmarks.Models.Orders { - public class OrdersContext : OrdersContextBase + public class OrdersSqlServerContext : OrdersContextBase { private readonly string _connectionString; private readonly bool _disableBatching; - public OrdersContext(string connectionString, IServiceProvider serviceProvider = null, bool disableBatching = false) + public OrdersSqlServerContext(string connectionString, IServiceProvider serviceProvider = null, bool disableBatching = false) : base(serviceProvider) { _connectionString = connectionString; diff --git a/benchmark/EFCore.SqlServer.Benchmarks/Models/Orders/OrdersFixture.cs b/benchmark/EFCore.SqlServer.Benchmarks/Models/Orders/OrdersSqlServerFixture.cs similarity index 60% rename from benchmark/EFCore.SqlServer.Benchmarks/Models/Orders/OrdersFixture.cs rename to benchmark/EFCore.SqlServer.Benchmarks/Models/Orders/OrdersSqlServerFixture.cs index 13436a0484..38b5b8c24c 100644 --- a/benchmark/EFCore.SqlServer.Benchmarks/Models/Orders/OrdersFixture.cs +++ b/benchmark/EFCore.SqlServer.Benchmarks/Models/Orders/OrdersSqlServerFixture.cs @@ -5,18 +5,18 @@ using System; namespace Microsoft.EntityFrameworkCore.Benchmarks.Models.Orders { - public class OrdersFixture : OrdersFixtureBase + public class OrdersSqlServerFixture : OrdersFixtureBase { private readonly string _connectionString; - public OrdersFixture(string databaseName) + public OrdersSqlServerFixture(string databaseName) { - _connectionString = $@"{BenchmarkEnvironment.Instance.BenchmarkDatabase}Database={databaseName};"; + _connectionString = SqlServerBenchmarkEnvironment.CreateConnectionString(databaseName); } public override OrdersContextBase CreateContext(IServiceProvider serviceProvider = null, bool disableBatching = false) { - return new OrdersContext(_connectionString, serviceProvider, disableBatching); + return new OrdersSqlServerContext(_connectionString, serviceProvider, disableBatching); } } } diff --git a/benchmark/EFCore.SqlServer.Benchmarks/Query/FuncletizationSqlServerTests.cs b/benchmark/EFCore.SqlServer.Benchmarks/Query/FuncletizationSqlServerTests.cs index 0c968314fc..f8c051068b 100644 --- a/benchmark/EFCore.SqlServer.Benchmarks/Query/FuncletizationSqlServerTests.cs +++ b/benchmark/EFCore.SqlServer.Benchmarks/Query/FuncletizationSqlServerTests.cs @@ -9,7 +9,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.Query { protected override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_Query_Funcletization"); + return new OrdersSqlServerFixture("Perf_Query_Funcletization"); } } } diff --git a/benchmark/EFCore.SqlServer.Benchmarks/Query/NavigationsQuerySqlServerTests.cs b/benchmark/EFCore.SqlServer.Benchmarks/Query/NavigationsQuerySqlServerTests.cs index 92cc36c4b6..4598be811d 100644 --- a/benchmark/EFCore.SqlServer.Benchmarks/Query/NavigationsQuerySqlServerTests.cs +++ b/benchmark/EFCore.SqlServer.Benchmarks/Query/NavigationsQuerySqlServerTests.cs @@ -9,7 +9,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.Query { protected override AdventureWorksContextBase CreateContext() { - return AdventureWorksFixture.CreateContext(); + return AdventureWorksSqlServerFixture.CreateContext(); } } } diff --git a/benchmark/EFCore.SqlServer.Benchmarks/Query/QueryCompilationSqlServerTests.cs b/benchmark/EFCore.SqlServer.Benchmarks/Query/QueryCompilationSqlServerTests.cs index 6dd3c5ab70..f3fc8e59e0 100644 --- a/benchmark/EFCore.SqlServer.Benchmarks/Query/QueryCompilationSqlServerTests.cs +++ b/benchmark/EFCore.SqlServer.Benchmarks/Query/QueryCompilationSqlServerTests.cs @@ -15,7 +15,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.Query public override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_Query_Compilation"); + return new OrdersSqlServerFixture("Perf_Query_Compilation"); } } } diff --git a/benchmark/EFCore.SqlServer.Benchmarks/Query/RawSqlQuerySqlServerTests.cs b/benchmark/EFCore.SqlServer.Benchmarks/Query/RawSqlQuerySqlServerTests.cs index 351649b638..078449f962 100644 --- a/benchmark/EFCore.SqlServer.Benchmarks/Query/RawSqlQuerySqlServerTests.cs +++ b/benchmark/EFCore.SqlServer.Benchmarks/Query/RawSqlQuerySqlServerTests.cs @@ -18,7 +18,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.Query protected override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_Query_RawSql"); + return new OrdersSqlServerFixture("Perf_Query_RawSql"); } } } diff --git a/benchmark/EFCore.SqlServer.Benchmarks/Query/SimpleQuerySqlServerTests.cs b/benchmark/EFCore.SqlServer.Benchmarks/Query/SimpleQuerySqlServerTests.cs index 014fbd498f..2a303be774 100644 --- a/benchmark/EFCore.SqlServer.Benchmarks/Query/SimpleQuerySqlServerTests.cs +++ b/benchmark/EFCore.SqlServer.Benchmarks/Query/SimpleQuerySqlServerTests.cs @@ -9,7 +9,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.Query { protected override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_Query_Simple"); + return new OrdersSqlServerFixture("Perf_Query_Simple"); } } } diff --git a/benchmark/EFCore.SqlServer.Benchmarks/Support/Program.cs b/benchmark/EFCore.SqlServer.Benchmarks/Support/Program.cs new file mode 100644 index 0000000000..6c209d3444 --- /dev/null +++ b/benchmark/EFCore.SqlServer.Benchmarks/Support/Program.cs @@ -0,0 +1,23 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Linq; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Columns; +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Diagnosers; +using BenchmarkDotNet.Exporters; +using BenchmarkDotNet.Exporters.Csv; +using BenchmarkDotNet.Horology; +using BenchmarkDotNet.Reports; +using BenchmarkDotNet.Running; + +// ReSharper disable once CheckNamespace +namespace Microsoft.EntityFrameworkCore.Benchmarks +{ + public class Program + { + private static void Main(string[] args) => EFCoreBenchmarkRunner.Run(args, typeof(Program).Assembly); + } +} diff --git a/benchmark/EFCore.SqlServer.Benchmarks/Support/SqlServerBenchmarkEnvironment.cs b/benchmark/EFCore.SqlServer.Benchmarks/Support/SqlServerBenchmarkEnvironment.cs new file mode 100644 index 0000000000..dc57d6f0c7 --- /dev/null +++ b/benchmark/EFCore.SqlServer.Benchmarks/Support/SqlServerBenchmarkEnvironment.cs @@ -0,0 +1,39 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.IO; +using Microsoft.Extensions.Configuration; + +#if RELEASE20 || RELEASE21 || RELEASE22 || DEBUG20 || DEBUG21 || DEBUG22 +using System.Data.SqlClient; +#else +using Microsoft.Data.SqlClient; +#endif + +// ReSharper disable once CheckNamespace +namespace Microsoft.EntityFrameworkCore.Benchmarks +{ + public static class SqlServerBenchmarkEnvironment + { + public static IConfiguration Config { get; } + + static SqlServerBenchmarkEnvironment() + { + var configBuilder = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("config.json", optional: true) + .AddEnvironmentVariables(); + + Config = configBuilder.Build() + .GetSection("Test:SqlServer"); + } + + private const string DefaultConnectionString + = "Data Source=(localdb)\\MSSQLLocalDB;Database=master;Integrated Security=True;Connect Timeout=30;ConnectRetryCount=0"; + + public static string DefaultConnection => Config["DefaultConnection"] ?? DefaultConnectionString; + + public static string CreateConnectionString(string name, string fileName = null, bool? multipleActiveResultSets = null) + => new SqlConnectionStringBuilder(DefaultConnection) { InitialCatalog = name }.ToString(); + } +} diff --git a/benchmark/EFCore.SqlServer.Benchmarks/UpdatePipeline/SimpleUpdatePipelineSqlServerTests.cs b/benchmark/EFCore.SqlServer.Benchmarks/UpdatePipeline/SimpleUpdatePipelineSqlServerTests.cs index d70c11de4e..577e23765f 100644 --- a/benchmark/EFCore.SqlServer.Benchmarks/UpdatePipeline/SimpleUpdatePipelineSqlServerTests.cs +++ b/benchmark/EFCore.SqlServer.Benchmarks/UpdatePipeline/SimpleUpdatePipelineSqlServerTests.cs @@ -13,7 +13,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.UpdatePipeline { public override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_UpdatePipeline_Simple"); + return new OrdersSqlServerFixture("Perf_UpdatePipeline_Simple"); } } @@ -21,7 +21,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.UpdatePipeline { public override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_UpdatePipeline_Simple"); + return new OrdersSqlServerFixture("Perf_UpdatePipeline_Simple"); } } @@ -29,7 +29,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.UpdatePipeline { public override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_UpdatePipeline_Simple"); + return new OrdersSqlServerFixture("Perf_UpdatePipeline_Simple"); } } @@ -37,7 +37,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.UpdatePipeline { public override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_UpdatePipeline_Simple"); + return new OrdersSqlServerFixture("Perf_UpdatePipeline_Simple"); } } } diff --git a/benchmark/EFCore.SqlServer.Benchmarks/config.json b/benchmark/EFCore.SqlServer.Benchmarks/config.json deleted file mode 100644 index f9e779b79e..0000000000 --- a/benchmark/EFCore.SqlServer.Benchmarks/config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "benchmarks": { - "runIterations": false, - "resultDatabases": { - "local": "Server=(localdb)\\mssqllocaldb;Database=Benchmarks;Trusted_Connection=True;" - }, - "benchmarkDatabase": "Server=(localdb)\\mssqllocaldb;Trusted_Connection=True;MultipleActiveResultSets=true;", - "productVersion": "EF Core SqlServer" - } -} \ No newline at end of file diff --git a/benchmark/EFCore.SqlServer.EF6.Benchmarks/config.json b/benchmark/EFCore.SqlServer.EF6.Benchmarks/config.json deleted file mode 100644 index 71a3799022..0000000000 --- a/benchmark/EFCore.SqlServer.EF6.Benchmarks/config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "benchmarks": { - "runIterations": false, - "resultDatabases": { - "local": "Server=(localdb)\\mssqllocaldb;Database=Benchmarks;Trusted_Connection=True;" - }, - "benchmarkDatabase": "Server=(localdb)\\mssqllocaldb;Trusted_Connection=True;MultipleActiveResultSets=true;", - "productVersion": "EF SqlServer 6.2" - } -} \ No newline at end of file diff --git a/benchmark/EFCore.Sqlite.Benchmarks/ChangeTracker/DbSetOperationSqliteTests.cs b/benchmark/EFCore.Sqlite.Benchmarks/ChangeTracker/DbSetOperationSqliteTests.cs index bdd12aacb6..a5d4d55c9a 100644 --- a/benchmark/EFCore.Sqlite.Benchmarks/ChangeTracker/DbSetOperationSqliteTests.cs +++ b/benchmark/EFCore.Sqlite.Benchmarks/ChangeTracker/DbSetOperationSqliteTests.cs @@ -13,7 +13,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.ChangeTracker { public override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_ChangeTracker_DbSetOperation"); + return new OrdersSqliteFixture("Perf_ChangeTracker_DbSetOperation"); } } @@ -21,7 +21,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.ChangeTracker { public override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_ChangeTracker_DbSetOperation"); + return new OrdersSqliteFixture("Perf_ChangeTracker_DbSetOperation"); } } } diff --git a/benchmark/EFCore.Sqlite.Benchmarks/ChangeTracker/FixupSqliteTests.cs b/benchmark/EFCore.Sqlite.Benchmarks/ChangeTracker/FixupSqliteTests.cs index e66dd5d27f..4fe436be12 100644 --- a/benchmark/EFCore.Sqlite.Benchmarks/ChangeTracker/FixupSqliteTests.cs +++ b/benchmark/EFCore.Sqlite.Benchmarks/ChangeTracker/FixupSqliteTests.cs @@ -13,7 +13,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.ChangeTracker { public override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_ChangeTracker_Fixup"); + return new OrdersSqliteFixture("Perf_ChangeTracker_Fixup"); } } @@ -21,7 +21,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.ChangeTracker { public override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_ChangeTracker_Fixup"); + return new OrdersSqliteFixture("Perf_ChangeTracker_Fixup"); } } } diff --git a/benchmark/EFCore.Sqlite.Benchmarks/EFCore.Sqlite.Benchmarks.csproj b/benchmark/EFCore.Sqlite.Benchmarks/EFCore.Sqlite.Benchmarks.csproj index fd1db18eec..ffa5fcd28f 100644 --- a/benchmark/EFCore.Sqlite.Benchmarks/EFCore.Sqlite.Benchmarks.csproj +++ b/benchmark/EFCore.Sqlite.Benchmarks/EFCore.Sqlite.Benchmarks.csproj @@ -11,32 +11,32 @@ true + + + + - + - + - + - + - - $(DefineConstants);OLD_FROM_SQL - - Always @@ -47,9 +47,4 @@ - - - - - diff --git a/benchmark/EFCore.Sqlite.Benchmarks/Initialization/ColdStartEnabledSqliteTest.cs b/benchmark/EFCore.Sqlite.Benchmarks/Initialization/ColdStartEnabledSqliteTest.cs index d6704534f8..b4e5b8a63f 100644 --- a/benchmark/EFCore.Sqlite.Benchmarks/Initialization/ColdStartEnabledSqliteTest.cs +++ b/benchmark/EFCore.Sqlite.Benchmarks/Initialization/ColdStartEnabledSqliteTest.cs @@ -9,7 +9,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.Initialization { protected override AdventureWorksContextBase CreateContext() { - return AdventureWorksFixture.CreateContext(); + return AdventureWorksSqliteFixture.CreateContext(); } } } diff --git a/benchmark/EFCore.Sqlite.Benchmarks/Models/AdventureWorks/AdventureWorksContext.cs b/benchmark/EFCore.Sqlite.Benchmarks/Models/AdventureWorks/AdventureWorksSqliteContext.cs similarity index 79% rename from benchmark/EFCore.Sqlite.Benchmarks/Models/AdventureWorks/AdventureWorksContext.cs rename to benchmark/EFCore.Sqlite.Benchmarks/Models/AdventureWorks/AdventureWorksSqliteContext.cs index 76896a0712..3b2be9697f 100644 --- a/benchmark/EFCore.Sqlite.Benchmarks/Models/AdventureWorks/AdventureWorksContext.cs +++ b/benchmark/EFCore.Sqlite.Benchmarks/Models/AdventureWorks/AdventureWorksSqliteContext.cs @@ -4,11 +4,11 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.Models.AdventureWorks { - public class AdventureWorksContext : AdventureWorksContextBase + public class AdventureWorksSqliteContext : AdventureWorksContextBase { private readonly string _connectionString; - public AdventureWorksContext(string connectionString) + public AdventureWorksSqliteContext(string connectionString) { _connectionString = connectionString; } diff --git a/benchmark/EFCore.Sqlite.Benchmarks/Models/AdventureWorks/AdventureWorksFixture.cs b/benchmark/EFCore.Sqlite.Benchmarks/Models/AdventureWorks/AdventureWorksSqliteFixture.cs similarity index 80% rename from benchmark/EFCore.Sqlite.Benchmarks/Models/AdventureWorks/AdventureWorksFixture.cs rename to benchmark/EFCore.Sqlite.Benchmarks/Models/AdventureWorks/AdventureWorksSqliteFixture.cs index a8c9903132..c40a33e1f5 100644 --- a/benchmark/EFCore.Sqlite.Benchmarks/Models/AdventureWorks/AdventureWorksFixture.cs +++ b/benchmark/EFCore.Sqlite.Benchmarks/Models/AdventureWorks/AdventureWorksSqliteFixture.cs @@ -6,10 +6,10 @@ using System.IO; namespace Microsoft.EntityFrameworkCore.Benchmarks.Models.AdventureWorks { - public static class AdventureWorksFixture + public static class AdventureWorksSqliteFixture { private static readonly string _baseDirectory - = Path.GetDirectoryName(new Uri(typeof(AdventureWorksFixture).Assembly.CodeBase).LocalPath); + = Path.GetDirectoryName(new Uri(typeof(AdventureWorksSqliteFixture).Assembly.CodeBase).LocalPath); private static readonly string _connectionString = $"Data Source={Path.Combine(_baseDirectory, "AdventureWorks2014.db")}"; @@ -17,7 +17,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.Models.AdventureWorks // This method is called from timed code, be careful when changing it public static AdventureWorksContextBase CreateContext() { - return new AdventureWorksContext(_connectionString); + return new AdventureWorksSqliteContext(_connectionString); } } } diff --git a/benchmark/EFCore.Sqlite.Benchmarks/Models/Orders/OrdersContext.cs b/benchmark/EFCore.Sqlite.Benchmarks/Models/Orders/OrdersSqliteContext.cs similarity index 79% rename from benchmark/EFCore.Sqlite.Benchmarks/Models/Orders/OrdersContext.cs rename to benchmark/EFCore.Sqlite.Benchmarks/Models/Orders/OrdersSqliteContext.cs index b40e4ebb0c..558047511f 100644 --- a/benchmark/EFCore.Sqlite.Benchmarks/Models/Orders/OrdersContext.cs +++ b/benchmark/EFCore.Sqlite.Benchmarks/Models/Orders/OrdersSqliteContext.cs @@ -6,12 +6,12 @@ using System; namespace Microsoft.EntityFrameworkCore.Benchmarks.Models.Orders { - public class OrdersContext : OrdersContextBase + public class OrdersSqliteContext : OrdersContextBase { private readonly string _connectionString; private readonly bool _disableBatching; - public OrdersContext(string connectionString, IServiceProvider serviceProvider = null, bool disableBatching = false) + public OrdersSqliteContext(string connectionString, IServiceProvider serviceProvider = null, bool disableBatching = false) : base(serviceProvider) { _connectionString = connectionString; diff --git a/benchmark/EFCore.Sqlite.Benchmarks/Models/Orders/OrdersFixture.cs b/benchmark/EFCore.Sqlite.Benchmarks/Models/Orders/OrdersSqliteFixture.cs similarity index 67% rename from benchmark/EFCore.Sqlite.Benchmarks/Models/Orders/OrdersFixture.cs rename to benchmark/EFCore.Sqlite.Benchmarks/Models/Orders/OrdersSqliteFixture.cs index 4c6e3c69c0..4526d3c688 100644 --- a/benchmark/EFCore.Sqlite.Benchmarks/Models/Orders/OrdersFixture.cs +++ b/benchmark/EFCore.Sqlite.Benchmarks/Models/Orders/OrdersSqliteFixture.cs @@ -6,21 +6,21 @@ using System.IO; namespace Microsoft.EntityFrameworkCore.Benchmarks.Models.Orders { - public class OrdersFixture : OrdersFixtureBase + public class OrdersSqliteFixture : OrdersFixtureBase { private static readonly string _baseDirectory - = Path.GetDirectoryName(new Uri(typeof(OrdersFixture).Assembly.CodeBase).LocalPath); + = Path.GetDirectoryName(new Uri(typeof(OrdersSqliteFixture).Assembly.CodeBase).LocalPath); private readonly string _connectionString; - public OrdersFixture(string databaseName) + public OrdersSqliteFixture(string databaseName) { _connectionString = $"Data Source={Path.Combine(_baseDirectory, databaseName + ".db")}"; } public override OrdersContextBase CreateContext(IServiceProvider serviceProvider = null, bool disableBatching = false) { - return new OrdersContext(_connectionString, serviceProvider, disableBatching); + return new OrdersSqliteContext(_connectionString, serviceProvider, disableBatching); } } } diff --git a/benchmark/EFCore.Sqlite.Benchmarks/Query/FuncletizationSqliteTests.cs b/benchmark/EFCore.Sqlite.Benchmarks/Query/FuncletizationSqliteTests.cs index 87af17bf0d..4062ba3de1 100644 --- a/benchmark/EFCore.Sqlite.Benchmarks/Query/FuncletizationSqliteTests.cs +++ b/benchmark/EFCore.Sqlite.Benchmarks/Query/FuncletizationSqliteTests.cs @@ -9,7 +9,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.Query { protected override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_Query_Funcletization"); + return new OrdersSqliteFixture("Perf_Query_Funcletization"); } } } diff --git a/benchmark/EFCore.Sqlite.Benchmarks/Query/NavigationsQuerySqliteTests.cs b/benchmark/EFCore.Sqlite.Benchmarks/Query/NavigationsQuerySqliteTests.cs index d3557e0cad..51f9c4fbd6 100644 --- a/benchmark/EFCore.Sqlite.Benchmarks/Query/NavigationsQuerySqliteTests.cs +++ b/benchmark/EFCore.Sqlite.Benchmarks/Query/NavigationsQuerySqliteTests.cs @@ -9,7 +9,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.Query { protected override AdventureWorksContextBase CreateContext() { - return AdventureWorksFixture.CreateContext(); + return AdventureWorksSqliteFixture.CreateContext(); } } } diff --git a/benchmark/EFCore.Sqlite.Benchmarks/Query/QueryCompilationSqliteTests.cs b/benchmark/EFCore.Sqlite.Benchmarks/Query/QueryCompilationSqliteTests.cs index a7854f4dc1..a2bfeea6e1 100644 --- a/benchmark/EFCore.Sqlite.Benchmarks/Query/QueryCompilationSqliteTests.cs +++ b/benchmark/EFCore.Sqlite.Benchmarks/Query/QueryCompilationSqliteTests.cs @@ -15,7 +15,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.Query public override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_Query_Compilation"); + return new OrdersSqliteFixture("Perf_Query_Compilation"); } } } diff --git a/benchmark/EFCore.Sqlite.Benchmarks/Query/RawSqlQuerySqliteTests.cs b/benchmark/EFCore.Sqlite.Benchmarks/Query/RawSqlQuerySqliteTests.cs index 7d8d62af5c..65aa414cef 100644 --- a/benchmark/EFCore.Sqlite.Benchmarks/Query/RawSqlQuerySqliteTests.cs +++ b/benchmark/EFCore.Sqlite.Benchmarks/Query/RawSqlQuerySqliteTests.cs @@ -19,7 +19,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.Query protected override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_Query_RawSql"); + return new OrdersSqliteFixture("Perf_Query_RawSql"); } } } diff --git a/benchmark/EFCore.Sqlite.Benchmarks/Query/SimpleQuerySqliteTests.cs b/benchmark/EFCore.Sqlite.Benchmarks/Query/SimpleQuerySqliteTests.cs index bc0d351d05..9d3c92c735 100644 --- a/benchmark/EFCore.Sqlite.Benchmarks/Query/SimpleQuerySqliteTests.cs +++ b/benchmark/EFCore.Sqlite.Benchmarks/Query/SimpleQuerySqliteTests.cs @@ -9,7 +9,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.Query { protected override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_Query_Simple"); + return new OrdersSqliteFixture("Perf_Query_Simple"); } } } diff --git a/benchmark/EFCore.Sqlite.Benchmarks/Support/Program.cs b/benchmark/EFCore.Sqlite.Benchmarks/Support/Program.cs new file mode 100644 index 0000000000..6c209d3444 --- /dev/null +++ b/benchmark/EFCore.Sqlite.Benchmarks/Support/Program.cs @@ -0,0 +1,23 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Linq; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Columns; +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Diagnosers; +using BenchmarkDotNet.Exporters; +using BenchmarkDotNet.Exporters.Csv; +using BenchmarkDotNet.Horology; +using BenchmarkDotNet.Reports; +using BenchmarkDotNet.Running; + +// ReSharper disable once CheckNamespace +namespace Microsoft.EntityFrameworkCore.Benchmarks +{ + public class Program + { + private static void Main(string[] args) => EFCoreBenchmarkRunner.Run(args, typeof(Program).Assembly); + } +} diff --git a/benchmark/EFCore.Sqlite.Benchmarks/UpdatePipeline/SimpleUpdatePipelineSqliteTests.cs b/benchmark/EFCore.Sqlite.Benchmarks/UpdatePipeline/SimpleUpdatePipelineSqliteTests.cs index 84e45cc849..caa0085b0a 100644 --- a/benchmark/EFCore.Sqlite.Benchmarks/UpdatePipeline/SimpleUpdatePipelineSqliteTests.cs +++ b/benchmark/EFCore.Sqlite.Benchmarks/UpdatePipeline/SimpleUpdatePipelineSqliteTests.cs @@ -13,7 +13,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.UpdatePipeline { public override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_UpdatePipeline_Simple"); + return new OrdersSqliteFixture("Perf_UpdatePipeline_Simple"); } } @@ -21,7 +21,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.UpdatePipeline { public override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_UpdatePipeline_Simple"); + return new OrdersSqliteFixture("Perf_UpdatePipeline_Simple"); } } @@ -29,7 +29,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.UpdatePipeline { public override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_UpdatePipeline_Simple"); + return new OrdersSqliteFixture("Perf_UpdatePipeline_Simple"); } } @@ -37,7 +37,7 @@ namespace Microsoft.EntityFrameworkCore.Benchmarks.UpdatePipeline { public override OrdersFixtureBase CreateFixture() { - return new OrdersFixture("Perf_UpdatePipeline_Simple"); + return new OrdersSqliteFixture("Perf_UpdatePipeline_Simple"); } } } diff --git a/benchmark/EFCore.Sqlite.Benchmarks/config.json b/benchmark/EFCore.Sqlite.Benchmarks/config.json deleted file mode 100644 index 74194d0237..0000000000 --- a/benchmark/EFCore.Sqlite.Benchmarks/config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "benchmarks": { - "runIterations": false, - "resultDatabases": { - "local": "Server=(localdb)\\mssqllocaldb;Database=Benchmarks;Trusted_Connection=True;" - }, - "benchmarkDatabase": "Server=(localdb)\\mssqllocaldb;Trusted_Connection=True;MultipleActiveResultSets=true;", - "productVersion": "EF Core Sqlite" - } -} \ No newline at end of file diff --git a/benchmark/Shared/BenchmarkEnvironment.cs b/benchmark/Shared/BenchmarkEnvironment.cs deleted file mode 100644 index 155c32cbfc..0000000000 --- a/benchmark/Shared/BenchmarkEnvironment.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.Extensions.Configuration; - -namespace Microsoft.EntityFrameworkCore.Benchmarks -{ - public class BenchmarkEnvironment - { - private static readonly Lazy _instance = new Lazy( - () => - { - var config = new ConfigurationBuilder() - .AddJsonFile("config.json") - .AddEnvironmentVariables() - .Build(); - - var resultDatabasesSection = config.GetSection("benchmarks:resultDatabases"); - - return new BenchmarkEnvironment - { - RunIterations = bool.Parse(config["benchmarks:runIterations"]), - ResultDatabases = resultDatabasesSection.GetChildren().Select(s => s.Value).ToArray(), - BenchmarkDatabase = config["benchmarks:benchmarkDatabase"], - ProductVersion = config["benchmarks:productVersion"], - CustomData = config["benchmarks:customData"] - }; - }); - - private BenchmarkEnvironment() - { - } - - public static BenchmarkEnvironment Instance => _instance.Value; - - public bool RunIterations { get; private set; } - public IEnumerable ResultDatabases { get; private set; } - public string BenchmarkDatabase { get; private set; } - public string ProductVersion { get; private set; } - public string CustomData { get; private set; } - } -} diff --git a/benchmark/Shared/Program.cs b/benchmark/Shared/Program.cs deleted file mode 100644 index ddaeb2fe2a..0000000000 --- a/benchmark/Shared/Program.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Linq; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Columns; -using BenchmarkDotNet.Configs; -using BenchmarkDotNet.Diagnosers; -using BenchmarkDotNet.Exporters; -using BenchmarkDotNet.Exporters.Csv; -using BenchmarkDotNet.Horology; -using BenchmarkDotNet.Reports; -using BenchmarkDotNet.Running; - -namespace Microsoft.EntityFrameworkCore.Benchmarks -{ - public static class Program - { - private static void Main(string[] args) - { - var config = DefaultConfig.Instance - .With(DefaultConfig.Instance.GetDiagnosers().Concat(new[] { MemoryDiagnoser.Default }).ToArray()); - - var index = Array.FindIndex(args, s => s == "--perflab"); - if (index >= 0) - { - var argList = args.ToList(); - argList.RemoveAt(index); - args = argList.ToArray(); - - config = config - .With(new[] - { - StatisticColumn.OperationsPerSecond, - new ParamsSummaryColumn() - }) - .With(new[] - { - MarkdownExporter.GitHub, - new CsvExporter( - CsvSeparator.Comma, - new SummaryStyle - { - PrintUnitsInHeader = true, - PrintUnitsInContent = false, - TimeUnit = TimeUnit.Microsecond, - SizeUnit = SizeUnit.KB - }) - }); - } - - BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, config); - } - } -}