Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Performance: Adds includes compiler optimize option #1764

Merged
merged 9 commits into from
Aug 11, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>CosmosBenchmark</RootNamespace>
<AssemblyName>CosmosBenchmark</AssemblyName>
<ServerGarbageCollection>true</ServerGarbageCollection>
<ServerGarbageCollection>true</ServerGarbageCollection>
<Optimize Condition="'$(Configuration)'=='Release'">true</Optimize>
</PropertyGroup>
<ItemGroup>
<None Include="KeyValue.json">
Expand Down Expand Up @@ -33,4 +34,4 @@
<PackageReference Include="Microsoft.Azure.Cosmos.Direct" Version="[$(DirectVersion)]" />
<PackageReference Include="Microsoft.Azure.Cosmos.Serialization.HybridRow" Version="[$(HybridRowVersion)]" />
</ItemGroup>
</Project>
</Project>
4 changes: 2 additions & 2 deletions Microsoft.Azure.Cosmos/src/Handler/RequestInvokerHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ public virtual async Task<ResponseMessage> SendAsync(
// user request might span multiple backend requests.
// This will still have a single request id for retry scenarios
ActivityScope activityScope = ActivityScope.CreateIfDefaultActivityId();
Debug.Assert(activityScope != null &&
(operationType != OperationType.SqlQuery || operationType != OperationType.Query || operationType != OperationType.QueryPlan),
Debug.Assert(activityScope == null || (activityScope != null &&
(operationType != OperationType.SqlQuery || operationType != OperationType.Query || operationType != OperationType.QueryPlan)),
"There should be an activity id already set");

try
Expand Down
1 change: 1 addition & 0 deletions Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<IncludeSource>false</IncludeSource>
<RootNamespace>Microsoft.Azure.Cosmos</RootNamespace>
<NoWarn>NU5125</NoWarn>
<Optimize Condition="'$(Configuration)'=='Release'">true</Optimize>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions templates/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ parameters:

jobs:
- job:
displayName: Tests ${{ parameters.BuildConfiguration }}
displayName: Tests Debug
pool:
vmImage: ${{ parameters.VmImage }}

Expand All @@ -22,7 +22,7 @@ jobs:
inputs:
command: test
projects: 'Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/*.csproj'
arguments: ${{ parameters.Arguments }} --configuration ${{ parameters.BuildConfiguration }} /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CopyLocalLockFileAssemblies=true /p:OS=${{ parameters.OS }}
arguments: ${{ parameters.Arguments }} --configuration Debug /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CopyLocalLockFileAssemblies=true /p:OS=${{ parameters.OS }}
publishTestResults: true
nugetConfigPath: NuGet.config
testRunTitle: Microsoft.Azure.Cosmos.Tests
Expand Down