StackExchange / StackExchange/StackExchange.Redis
Interface exposes only array based interface which requires external allocations of arrays
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.2k
- Forks
- 1.6k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 43
Description
In high performance code one might want to reduce allocations to minimum and pre-allocate/reuse the memory needed.
Currently with the API which directly exposes raw arrays this is not possible.
I would suggest adding/changing the APIs like:
void HashSet(RedisKey key, HashEntry[] hashFields, CommandFlags flags = CommandFlags.None);
something like
void HashSet(RedisKey key, Memory<HashEntry> hashFields, CommandFlags flags = CommandFlags.None);
or maybe even:
void HashSet(RedisKey key, Span<HashEntry> hashFields, CommandFlags flags = CommandFlags.None);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing array-based HashSet API in StackExchange.Redis and review how its HashEntry and CommandFlags parameters are exposed. Compare the proposed Memory and Span alternatives, then define the API and compatibility requirements; done requires an agreed design and corresponding implementation tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, redis
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100