Efficient array views have been a long standing issue in Julia. Recently, I decided to tackle this problem again, and for this purpose, created a package ArrayViews.jl to explore a generic & efficient approach.
There remains some work to be done, but the framework is largely there. While I will continue to work on this package, I would like to solicit comments here.
The ultimate goal is to move this to the Base when it is ready, to take the place of the current subarray system.
An important feature of this approach is that it has two view types ContiguousView and StridedView. Each strided view is associated with a static number called contiguous rank, which can be used to determine (statically) the contiguousness of a subview thereof.
A contiguous view (with more compact representation and faster indexing) will be returned whenever the contiguousness of a view can be determined statically, thus substantially improving indexing efficiency in a lot of common situations.
Efficient array views have been a long standing issue in Julia. Recently, I decided to tackle this problem again, and for this purpose, created a package ArrayViews.jl to explore a generic & efficient approach.
There remains some work to be done, but the framework is largely there. While I will continue to work on this package, I would like to solicit comments here.
The ultimate goal is to move this to the Base when it is ready, to take the place of the current subarray system.
An important feature of this approach is that it has two view types
ContiguousViewandStridedView. Each strided view is associated with a static number called contiguous rank, which can be used to determine (statically) the contiguousness of a subview thereof.A contiguous view (with more compact representation and faster indexing) will be returned whenever the contiguousness of a view can be determined statically, thus substantially improving indexing efficiency in a lot of common situations.