You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This refers to possible improvements to the work in #2027.
It doesn't make sense to tackle this before that work is reviewed and merged.
Overview
pdata ("pointer data", I believe) is represented by the Datum type.
In #2027 this is an alias for neuron::container::generic_data_handle, which is a generic type that can wrap handles to mechanism data values that are stable w.r.t. permutations and reallocation of the underlying data structures.
Part of the cost of this flexibility is that dereferencing a generic_data_handle to obtain the pointed-to value is relatively indirect and expensive, so we don't want to do that during the compute-intensive part of the simulation.
To achieve this, before running the compute-intensive part of the simulation we generate "cache vectors" of raw pointers (double*) for pdata fields that refer to double values, and use those when we run the simulation.
It may be possible to extend this logic for further performance gains. For example, if the pointed-to value is known to be constant during the simulation, then instead of caching a double* that refers to a constant value, we could cache the constant value itself and remove some more runtime indirection. @olupton suspects that pointers to area values might fall into this category.
Another example is pdata fields that hold literal values of types such as int. We may be able to gain more performance by moving these to be explicit int-typed data (like the double-typed data in data) instead of wrapping them inside pdata. Ion types are an example of int data that is stored inside pdata.
The text was updated successfully, but these errors were encountered:
Preamble
This refers to possible improvements to the work in #2027.
It doesn't make sense to tackle this before that work is reviewed and merged.
Overview
pdata
("pointer data", I believe) is represented by theDatum
type.In #2027 this is an alias for
neuron::container::generic_data_handle
, which is a generic type that can wrap handles to mechanism data values that are stable w.r.t. permutations and reallocation of the underlying data structures.Part of the cost of this flexibility is that dereferencing a
generic_data_handle
to obtain the pointed-to value is relatively indirect and expensive, so we don't want to do that during the compute-intensive part of the simulation.To achieve this, before running the compute-intensive part of the simulation we generate "cache vectors" of raw pointers (
double*
) forpdata
fields that refer todouble
values, and use those when we run the simulation.It may be possible to extend this logic for further performance gains. For example, if the pointed-to value is known to be constant during the simulation, then instead of caching a
double*
that refers to a constant value, we could cache the constant value itself and remove some more runtime indirection. @olupton suspects that pointers to area values might fall into this category.Another example is
pdata
fields that hold literal values of types such asint
. We may be able to gain more performance by moving these to be explicitint
-typed data (like thedouble
-typed data indata
) instead of wrapping them insidepdata
. Ion types are an example ofint
data that is stored insidepdata
.The text was updated successfully, but these errors were encountered: