{"action":"created","issue":{"url":"https://api.github.com/repos/Spreads/Spreads/issues/34","labels_url":"https://api.github.com/repos/Spreads/Spreads/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/Spreads/Spreads/issues/34/comments","events_url":"https://api.github.com/repos/Spreads/Spreads/issues/34/events","html_url":"https://github.com/Spreads/Spreads/issues/34","id":127768588,"number":34,"title":"Memory Allocations: Know Your Enemy","user":{"login":"buybackoff","id":489852,"avatar_url":"https://avatars.githubusercontent.com/u/489852?v=3","gravatar_id":"","url":"https://api.github.com/users/buybackoff","html_url":"https://github.com/buybackoff","followers_url":"https://api.github.com/users/buybackoff/followers","following_url":"https://api.github.com/users/buybackoff/following{/other_user}","gists_url":"https://api.github.com/users/buybackoff/gists{/gist_id}","starred_url":"https://api.github.com/users/buybackoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buybackoff/subscriptions","organizations_url":"https://api.github.com/users/buybackoff/orgs","repos_url":"https://api.github.com/users/buybackoff/repos","events_url":"https://api.github.com/users/buybackoff/events{/privacy}","received_events_url":"https://api.github.com/users/buybackoff/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Spreads/Spreads/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/Spreads/Spreads/labels/performance","name":"performance","color":"207de5"},{"url":"https://api.github.com/repos/Spreads/Spreads/labels/performance-memory","name":"performance-memory","color":"207de5"},{"url":"https://api.github.com/repos/Spreads/Spreads/labels/up%20for%20grabs","name":"up for grabs","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-20T19:47:38Z","updated_at":"2016-01-20T20:42:03Z","closed_at":null,"body":"#### TODOs\r\n* [ ] Do not use F# tuple expansion as per #32\r\n* [ ] Do not use F# ref cells if possible\r\n* [ ] Static constructor in base untyped Series is called many times\r\n\r\n...\r\n\r\n#### Readme index example memory profiling\r\nPreallocated capacity: DateTime has 1000 allcoations - initially we allocate DT[2] for regular keys, that could be just fields.\r\n\r\nDouble[] is allocated exactly 501 time - 500 for series and 1 for ZipN vArr.\r\n\r\nF# ref cells are the main enemy now.\r\n\r\nMost numbers that are multiples of 500x are allocated for the entire lifetime of the test. This pic proves the point that Spreads library does not generate garbage.\r\n\r\n![image](https://cloud.githubusercontent.com/assets/489852/12460936/580a2cc6-bfc7-11e5-8f95-bb41059c5f3a.png)\r\n"},"comment":{"url":"https://api.github.com/repos/Spreads/Spreads/issues/comments/173353119","html_url":"https://github.com/Spreads/Spreads/issues/34#issuecomment-173353119","issue_url":"https://api.github.com/repos/Spreads/Spreads/issues/34","id":173353119,"user":{"login":"buybackoff","id":489852,"avatar_url":"https://avatars.githubusercontent.com/u/489852?v=3","gravatar_id":"","url":"https://api.github.com/users/buybackoff","html_url":"https://github.com/buybackoff","followers_url":"https://api.github.com/users/buybackoff/followers","following_url":"https://api.github.com/users/buybackoff/following{/other_user}","gists_url":"https://api.github.com/users/buybackoff/gists{/gist_id}","starred_url":"https://api.github.com/users/buybackoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buybackoff/subscriptions","organizations_url":"https://api.github.com/users/buybackoff/orgs","repos_url":"https://api.github.com/users/buybackoff/repos","events_url":"https://api.github.com/users/buybackoff/events{/privacy}","received_events_url":"https://api.github.com/users/buybackoff/received_events","type":"User","site_admin":false},"created_at":"2016-01-20T20:42:02Z","updated_at":"2016-01-20T20:42:02Z","body":"Mutable locals are converted to ref cell implicitly in object expressions. Need to create a separate class in the same way as the struct cursor. The idea is that mutable series and their cursors are usually created for lifetime of process and an we could safely allocate objects for this. For chunks and temporal allocations or for `foreach` loops we always use struct cursors."}}