FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Initial POC commit for adding ReadOnlyMemory overloads to StringSet o… by Stabzs · Pull Request #2221 · StackExchange/StackExchange.Redis · GitHub

Initial POC commit for adding ReadOnlyMemory overloads to StringSet o… - #2221

Draft
Stabzs wants to merge 1 commit into
StackExchange:mainfrom
Stabzs:pooled_overloads
Draft

Initial POC commit for adding ReadOnlyMemory overloads to StringSet o…#2221
Stabzs wants to merge 1 commit into
StackExchange:mainfrom
Stabzs:pooled_overloads

Conversation

Stabzs commented Aug 18, 2022

Copy link
Copy Markdown

…perations.

/// <remarks>
/// <seealso href="https://redis.io/commands/mset"/>,
/// <seealso href="https://redis.io/commands/msetnx"/>
/// </remarks>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

possibly worth a warning about FireAndForget being dangerous here if the ReadOnlyMemory is going to be recycled/reused?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Definitely seems wise, thank you. I'll add warnings for all of the new methods taking ReadOnlyMemory. If the approach looks good overall, I'll continue expanding the surface area.


for (int i = 0; i < outer.Length; ++i)
{
inner[i] = ToInner(outer.Span[i]);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Accessing .Span is relatively expensive; this should be done outside the loop and resused.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The ++i is very unusual for C#, note

Stabzs Aug 26, 2022
edited
Loading

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Makes sense, thanks! I'll make the changes to cache all call sites for .Span.

The ++i was copied from line 801 of the diff. I assumed that was intentional and copied it here. Is that an incorrect usage?

mgravell commented Oct 11, 2022 via email

Copy link
Copy Markdown
Collaborator

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL