digitalmars.D.learn - Structure of Arrays vs Array of Structures
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (5/11) Aug 26 2019 I have made some significant optimizations with regards to
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (10/13) Aug 26 2019 What is the preferred way to implement to support foreach over
- a11e99z (10/25) Aug 26 2019 1) not sure about opSlice cuz user can allocate every time when
https://forum.dlang.org/post/cvsajblducyanpqahrwe forum.dlang.org On Monday, 15 May 2017 at 06:44:53 UTC, Nordlöw wrote:After having watched Jonathan Blow's talk on Jai https://www.youtube.com/watch?v=TH9VCN6UkyQ&t=2880s I realized that we should add his Array-of-Structures (AoS) concept to Phobos, preferrably in std.typecons.StructArrays, as something like template StructArrays(Members...)I have made some significant optimizations with regards to compilation performance at https://github.com/nordlow/phobos-next/blob/master/src/soa.d
Aug 26 2019
On Monday, 26 August 2019 at 09:54:30 UTC, Per Nordlöw wrote:I have made some significant optimizations with regards to compilation performance at https://github.com/nordlow/phobos-next/blob/master/src/soa.dWhat is the preferred way to implement to support foreach over `x` in struct S { int i; float f; } auto x = SOA!S(); foreach (S; x[]) { } ? Implement `opSlice` that returns a SOA.Range type?
Aug 26 2019
On Monday, 26 August 2019 at 09:58:30 UTC, Per Nordlöw wrote:On Monday, 26 August 2019 at 09:54:30 UTC, Per Nordlöw wrote:1) not sure about opSlice cuz user can allocate every time when he need S[..] from SOA. easy call for user but its too expensive op. maybe better to define global array( T )( SOA!T {opt: int beg, int end}) that returns array.I have made some significant optimizations with regards to compilation performance at https://github.com/nordlow/phobos-next/blob/master/src/soa.dWhat is the preferred way to implement to support foreach over `x` in struct S { int i; float f; } auto x = SOA!S(); foreach (S; x[]) { } ? Implement `opSlice` that returns a SOA.Range type?x.array or array( x ) or x.array( 10, 20)looks like DRT that means "some range to newly allocated array". and SOA to S is some calculated range - need construct each element. 2) x.items returns SOA.Range
Aug 26 2019