Skip to content

Investigate using Span in BigInteger implementation #22609

@axelheer

Description

@axelheer

As already mentioned within #22387 the all-new Span should bring many benefits to BigInteger.

  • We currently use pointers to spare some index calculations (performance) and "abstract" the differences between ordinary arrays and stackalloc based stuff --> use spans instead
  • We currently copy the array containing the actual number after every operation to trim leading zeros --> use span.slice instead?
  • And maybe there's more...

We cannot get grid of unsafe code completely since there are stack-vs-heap paths based on stackalloc, but all the pointer based stuff should gracefully disappear; I think.

I'm interested to dive into this, after the summer or so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Cost:MWork that requires one engineer up to 2 weeksarea-System.NumericsenhancementProduct code improvement that does NOT require public API changes/additionshelp wanted[up-for-grabs] Good issue for external contributorstenet-performancePerformance related issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions