Skip to content

more performance faster? #7

@sgf

Description

@sgf
        public  UInt16 len 
        {
            readonly get => (UInt16)BitPrimitives.ReadUInt16LSB(other, 5, 11);
             set => BitPrimitives.WriteUInt16LSB(ref other, 5, (UInt16)value, 11);
        }

if like this will better:

    public ushort len {
        [inline(256)] readonly get => (ushort)((other >> 3) & 0x07FF);
        [inline(256)] set => other = (ushort)((other & ~(0x07FF << 3)) | ((value & 0x07FF) << 3));
    }

If done to its fullest potential, it might be possible to generate two structures: one for building and one for reading only, thus fully benefiting from compiler optimizations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions