Feasibility of a Span class in java

Remi Forax forax at univ-mlv.fr
Mon Nov 7 17:33:55 UTC 2022


It's on my TODO list :) 

You create an interface 
interface MutableSpan { 
int value(); 
void value(int value); 
} 

and you can map it to any Panama memory because this is implemented as value class with two fields, a memory segment (or whatever the actual name) and an index. 
Then you need to see a contiguous space of memory as a List of span objects where the value class instances representing the value are created on the fly when asked. 

Rémi 

> From: "Red IO" <redio.development at gmail.com>
> To: "panama-dev" <panama-dev at openjdk.org>
> Sent: Monday, November 7, 2022 5:59:28 PM
> Subject: Feasibility of a Span class in java

> Following the development and plans for both Panama's memory access api and the
> required changes provided by Valhalla while looking at c#'s directions for the
> last few years I was wondering if writing a class that serves as a universal
> and easy-to-use interface for accessing memory of all sorts of "value based"
> types inspired by c#' s Span struct would be beneficial for Java. Of course
> this assumes the completion of the memory api (panama) , the generic
> unification (Valhalla) and custom value based types (Valhalla). The idea is to
> speed up array and string manipulation by using short lived slicing objects
> (Span). I already wrote a poorly implemented slicer for strings and saw
> incredible performance gains in comon operations like substring and split.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20221107/237d89bb/attachment.htm>


More information about the panama-dev mailing list