{"action":"created","issue":{"url":"https://api.github.com/repos/brian-team/brian2/issues/996","repository_url":"https://api.github.com/repos/brian-team/brian2","labels_url":"https://api.github.com/repos/brian-team/brian2/issues/996/labels{/name}","comments_url":"https://api.github.com/repos/brian-team/brian2/issues/996/comments","events_url":"https://api.github.com/repos/brian-team/brian2/issues/996/events","html_url":"https://github.com/brian-team/brian2/pull/996","id":354775523,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExNDU3MTg4","number":996,"title":"[MRG] Optimization for refractoriness calculation","user":{"login":"mstimberg","id":1381982,"node_id":"MDQ6VXNlcjEzODE5ODI=","avatar_url":"https://avatars0.githubusercontent.com/u/1381982?v=4","gravatar_id":"","url":"https://api.github.com/users/mstimberg","html_url":"https://github.com/mstimberg","followers_url":"https://api.github.com/users/mstimberg/followers","following_url":"https://api.github.com/users/mstimberg/following{/other_user}","gists_url":"https://api.github.com/users/mstimberg/gists{/gist_id}","starred_url":"https://api.github.com/users/mstimberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mstimberg/subscriptions","organizations_url":"https://api.github.com/users/mstimberg/orgs","repos_url":"https://api.github.com/users/mstimberg/repos","events_url":"https://api.github.com/users/mstimberg/events{/privacy}","received_events_url":"https://api.github.com/users/mstimberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-28T15:07:52Z","updated_at":"2018-08-28T15:43:31Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/brian-team/brian2/pulls/996","html_url":"https://github.com/brian-team/brian2/pull/996","diff_url":"https://github.com/brian-team/brian2/pull/996.diff","patch_url":"https://github.com/brian-team/brian2/pull/996.patch"},"body":"See discussion in #991 . The changes in this PR are:\r\n* `timestep` function is no longer safe to use with infinity values\r\n* `timestep` function uses `int64` to avoid overflow\r\n* Instead of setting `lastspike` to `-inf*second` for neurons that never spiked, we now set this value to `-10000*second`\r\n* C++ and Cython code generation has been refactored so that scalar variables are read in the scalar code block (i.e. outside of the loop), regardless of whether they are used in the scalar or vector code. This is particularly relevant for `dt` and `t`.\r\n\r\nThe last change speeds up things considerably, even though the use of `int64` slows down things again. Nevertheless, if we are looking at the time the stateupdater takes in the context of a real simulation (CUBA example), this all now looks pretty reasonable (rough \"best of 3\" times, do not take them too seriously):\r\n\r\n| *target/branch*        | master+legacy        | master | This PR  |\r\n| ------------- | ------------------:| -----------------------:| ---------------:|\r\n| **weave**       | 126ms | 203ms | 132ms | \r\n| **Cython**      | 196ms | 910ms | 209ms |\r\n| **numpy**     | 970ms | 1610ms | 1250ms |\r\n| **C++ standalone** | 104ms | 203ms | 109ms |\r\n\r\n\"master+legacy\" means activating the preference that switches off the use of the `timestep` function.\r\n"},"comment":{"url":"https://api.github.com/repos/brian-team/brian2/issues/comments/416636483","html_url":"https://github.com/brian-team/brian2/pull/996#issuecomment-416636483","issue_url":"https://api.github.com/repos/brian-team/brian2/issues/996","id":416636483,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjYzNjQ4Mw==","user":{"login":"thesamovar","id":2903870,"node_id":"MDQ6VXNlcjI5MDM4NzA=","avatar_url":"https://avatars0.githubusercontent.com/u/2903870?v=4","gravatar_id":"","url":"https://api.github.com/users/thesamovar","html_url":"https://github.com/thesamovar","followers_url":"https://api.github.com/users/thesamovar/followers","following_url":"https://api.github.com/users/thesamovar/following{/other_user}","gists_url":"https://api.github.com/users/thesamovar/gists{/gist_id}","starred_url":"https://api.github.com/users/thesamovar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thesamovar/subscriptions","organizations_url":"https://api.github.com/users/thesamovar/orgs","repos_url":"https://api.github.com/users/thesamovar/repos","events_url":"https://api.github.com/users/thesamovar/events{/privacy}","received_events_url":"https://api.github.com/users/thesamovar/received_events","type":"User","site_admin":false},"created_at":"2018-08-28T15:43:31Z","updated_at":"2018-08-28T15:43:31Z","author_association":"MEMBER","body":"I think you've nailed it. Great work!"}}
{"actor":{"display_login":"thesamovar"}}