Skip to content

Add NET 8.0 target to Microsoft.Bcl.Memory package #104185

@tarekgh

Description

@tarekgh

Description

.NET 9.0 introduced Base64Url, and we are providing a polyfill for this type in Microsoft.Bcl.Memory to enable its use in earlier versions of .NET. The Base64Url implementation in .NET 9.0 leverages vectorization for improved performance. However, the polyfill implementation does not use vectorization, as it is not available in older framework versions. Although vectorization is possible in .NET 8.0, Microsoft.Bcl.Memory does not currently target .NET 8.0 specifically. When using Microsoft.Bcl.Memory on .NET 8.0, the polyfill implementation without vectorization is used. This issue tracks the addition of a .NET 8.0 target to Microsoft.Bcl.Memory, which will enable vectorization as well.

A quick test indicates that the current implementation, which uses vectorization, relies on the internal members of the public Ascii class: VectorContainsNonAsciiChar, ExtractAsciiVector, StoreVectorAndZip, Load4xVector128AndUnzip, and ShuffleUnsafe. These members need to be refactored to enable their use when targeting .NET 8.0.

Reproduction Steps

Run any test app on .NET 8.0 with referencing Microsoft.Bcl.Memory.

Expected behavior

Vectorization should be used

Actual behavior

No Vectorization is used

Regression?

No

Known Workarounds

Target .NET 9.0 instead.

Configuration

.NET 8.0

Other information

No response

Metadata

Metadata

Assignees

Labels

area-System.MemoryenhancementProduct code improvement that does NOT require public API changes/additions

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions