hazelcast / hazelcast/hazelcast-csharp-client

Hot Paths Cleanup [API-2059]

Open
#365 1 comment 0 reactions 0 assignees View on GitHub
Jira Type: Enhancement
Dominant language
C#
Stars
107
Forks
52
PR merge metrics
No merged PRs in 30d

Description

### Argument Checks

Many of our methods look like:
```csharp
public void DoSomething(Thing thing)
{
if (thing == null) throw new ArgumentNullException(nameof(thing));
```
where we *know* that we are (in theory at least) never going to pass `null`. This means we are adding a fair amount of checks in the "hot paths" and is this a performance issue? It may be dangerous to just remove all the checks, OTOH using the new `#nullable` feature of C#, we may do:
```csharp
public void DoSomething([NotNull] Thing thing)
{
// assume it's not null
```

### CancellationToken

Many of our methods accept a `CancellationToken` even though our public API does not expose it, and therefore it's always going to be `CancellationToken.None`. Can this be a performance issue in hot paths, and should we just remove the parameter since it's never used?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.