dotnet / dotnet/wcf

Support pre-caching ContractDescription

Open
#4,424 0 comments 0 reactions 0 assignees View on GitHub
enhancement tooling triaged
Dominant language
C#
Stars
1.8k
Forks
576
Avg merge
6d 9h
Merged PRs (30d)
2

Description

Please add support for pre-caching the ContractDescription to improve first use performance on large SOAP clients.

## Background
When using dotnet-svcutil generated SOAP clients for the first time, the ContractDescription is generated via reflection. The amount of time spent in reflection is correlated with the number of operations and size of the source WSDL file. Pre-caching the ContractDescription would save huge chunks of time when calling a SOAP client for the first time.

## Metrics
Below are metrics from an ongoing implementation at UW. We put each generated ServiceReference in it's own class library project. During testing we verified and measured network round-trip times with an IEndpointBehavior and IClientMessageInspector. The implementation uses:
- .NET Core 3.1
- dotnet-svcutil

### Library A
- 180k lines of generated code in Reference.cs.
- 298 operations.
- System.ServiceModel dependencies are at 4.7.*.
- First call takes 15-20 seconds.
- All of this time is spent pre-network IO.
- Network round-trip takes about .5 seconds.

### Library B
- 26k lines of generated code in Reference.cs.
- 26 operations.
- System.ServiceModel dependencies are at 4.7.*.
- First call takes 1-2 seconds.
- All of this time is spent pre-network IO.
- Network round-trip takes about .25 seconds.

Previous discussion here: https://github.com/dotnet/wcf/issues/3247#issuecomment-721334205
#3247

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.