# Possibility of speeding up Poisson spike generation

**URL:** <https://brian.discourse.group/t/possibility-of-speeding-up-poisson-spike-generation/1342>\
**Category:** Support\
**Tags:** performance, poisson\
**Created:** [5 December 2024 16:52 UTC](https://brian.discourse.group/t/possibility-of-speeding-up-poisson-spike-generation/1342 "2024-12-05T16:52:05Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![mstimberg](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/mstimberg/32/11_2.png) [@mstimberg](https://brian.discourse.group/u/mstimberg)\
**Post date:** [10 December 2024 15:59 UTC](https://brian.discourse.group/t/possibility-of-speeding-up-poisson-spike-generation/1342/21 "2024-12-10T15:59:27Z")

</div>

Hi @DavidKing2020. Did you double-check that you get the same number of spikes as with the `rand()<rate*dt` method? The code for all code objects except the `input_neurons_spike_thresholder_codeobject` should be exactly identical to the previous code, so I don’t have any explication why this one should take more time than before…

---

<div class="post-metadata">

**Author:** ![DavidKing2020](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@DavidKing2020](https://brian.discourse.group/u/DavidKing2020)\
**Post date:** [10 December 2024 16:07 UTC](https://brian.discourse.group/t/possibility-of-speeding-up-poisson-spike-generation/1342/22 "2024-12-10T16:07:04Z")

</div>

Hi @mstimberg , my memory actually slipped. The timing of s\_input2e0\_post\_codeobject is actually the same with the new and original method as shown the following timing profile with the “rand()\<rate\*dt” method:.

```
 input_neurons_spike_thresholder_codeobject 15.14 ms 42.87 %
 s_input2e0_post_codeobject 10.61 ms 30.03 %
 s_input2e0_pre_plastic_codeobject 1.68 ms 4.76 %
 exci_neurons0_stateupdater_codeobject 1.42 ms 4.02 %

```

The Possion spike timing is indeed improved by ~x5. Thanks so much for all the help!

[Previous page](https://brian.discourse.group/t/possibility-of-speeding-up-poisson-spike-generation/1342.md?page=1)
