fnsneuralsimulator / FNS-simulator

Repository of the event-driven simulator package
Other
7 stars 2 forks source link

Recommendation: Don't use boxed primitives #1

Closed frsfnrrg closed 5 years ago

frsfnrrg commented 5 years ago

Hi,

I was recently reading the arxiv paper 1v46800.1081 , and the performance results (20s runtime for 4s realtime with ~45K connections) seemed unusual. Inspection of the source code revealed that many classes used the wrapper classes over primitives rather than the primitives themselves, i.e., Double instead of double, or Integer instead of int, or Long instead of long. This indirection is expensive; see also the last paragraph of https://docs.oracle.com/javase/1.5.0/docs/guide/language/autoboxing.html .

knizontes commented 5 years ago

Hi, we needed every field as object in the earlier stages of the simulator, when the architecture was thought to allow the serialization to disk of the neuron topology of each node. This was desired to made possible to re-execute multiple test with the exact same neuronal topology (which otherwise, at the neurons level, is re-build in force of probabilistic parameters at each simulation). Now we estimate no more relevant to maintain such "topology-saving" mechanism, so we are dismissing as far as possible object fields as you correctly suggest.

Thank you kindly for your note!

Emanuele