{"action":"created","issue":{"url":"https://api.github.com/repos/ds300/derivablejs/issues/37","repository_url":"https://api.github.com/repos/ds300/derivablejs","labels_url":"https://api.github.com/repos/ds300/derivablejs/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/ds300/derivablejs/issues/37/comments","events_url":"https://api.github.com/repos/ds300/derivablejs/issues/37/events","html_url":"https://github.com/ds300/derivablejs/pull/37","id":150650472,"number":37,"title":"New Algorithm","user":{"login":"ds300","id":1242537,"avatar_url":"https://avatars.githubusercontent.com/u/1242537?v=3","gravatar_id":"","url":"https://api.github.com/users/ds300","html_url":"https://github.com/ds300","followers_url":"https://api.github.com/users/ds300/followers","following_url":"https://api.github.com/users/ds300/following{/other_user}","gists_url":"https://api.github.com/users/ds300/gists{/gist_id}","starred_url":"https://api.github.com/users/ds300/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ds300/subscriptions","organizations_url":"https://api.github.com/users/ds300/orgs","repos_url":"https://api.github.com/users/ds300/repos","events_url":"https://api.github.com/users/ds300/events{/privacy}","received_events_url":"https://api.github.com/users/ds300/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":22,"created_at":"2016-04-24T10:53:07Z","updated_at":"2016-12-15T16:38:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ds300/derivablejs/pulls/37","html_url":"https://github.com/ds300/derivablejs/pull/37","diff_url":"https://github.com/ds300/derivablejs/pull/37.diff","patch_url":"https://github.com/ds300/derivablejs/pull/37.patch"},"body":"Up until now, DerivableJS used a mark-and-sweep style algorithm to both propagate change and free unused memory.\n\nThis had a couple of minor performance implications, and one obscure-but-serious memory leak vulnerability (see #36).\n\nThis reimplementation of DerivableJS' core data structures removes the mark-and-sweep stuff, replacing it with a significantly simpler system inspired by Clojure's epochal STM.\n\nThe practical implications are: \n- atoms never ever store references to derivations. Only to reactors. This is ideal, and solves the memory management issue once and for all.\n- the time complexity of updating atoms is now linear in the number of dependent reactors rather than in the number of dependent (derivations + reactors), and should be much more performant due to cache locality goodness.\n- the cost of dereferencing derivables should be either similar or faster than before, but I'll have to do benchmarking to be sure of this.\n- smaller file size (.min.gz has gone from **4,330 bytes** down to **3,718 bytes**. Makes all the difference.)\n\nThe progress of this reimplementation is as follows:\n- [x] typescript prototype of epochal system to verify viability \n- [x] retrofit DJS with epochal system\n- [x] get all the unit tests passing\n- [x] trial epochal system in real-world projects already using DJS\n- [x] modernize code base (npm build scripts, es6 modules + rollup, CI)\n- [x] do white box testing. get 100% test coverage.\n- [x] check performance and rework if necessary\n- [ ] modify read-me to talk about push-pull as opposed to mark-and-sweep, like [Agera](https://github.com/google/agera)\n- [ ] release\n"},"comment":{"url":"https://api.github.com/repos/ds300/derivablejs/issues/comments/267375599","html_url":"https://github.com/ds300/derivablejs/pull/37#issuecomment-267375599","issue_url":"https://api.github.com/repos/ds300/derivablejs/issues/37","id":267375599,"user":{"login":"oskbor","id":1297789,"avatar_url":"https://avatars.githubusercontent.com/u/1297789?v=3","gravatar_id":"","url":"https://api.github.com/users/oskbor","html_url":"https://github.com/oskbor","followers_url":"https://api.github.com/users/oskbor/followers","following_url":"https://api.github.com/users/oskbor/following{/other_user}","gists_url":"https://api.github.com/users/oskbor/gists{/gist_id}","starred_url":"https://api.github.com/users/oskbor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oskbor/subscriptions","organizations_url":"https://api.github.com/users/oskbor/orgs","repos_url":"https://api.github.com/users/oskbor/repos","events_url":"https://api.github.com/users/oskbor/events{/privacy}","received_events_url":"https://api.github.com/users/oskbor/received_events","type":"User","site_admin":false},"created_at":"2016-12-15T16:38:49Z","updated_at":"2016-12-15T16:38:49Z","body":"Ill send you a mana potion for Christmas 🎅\n\nOn Wed, Dec 14, 2016, 10:10 David Sheldrick <notifications@github.com>\nwrote:\n\n> Oh gosh. Well the code is pretty tight (currently released as beta), but I\n> haven't had the extra-curricular moxie to finish off the docs and landing\n> page in recent months. I've got a big 5-week chunk of holiday coming up in\n> February; maybe that with replenish my OSS mana.\n>\n> On 14 Dec 2016 8:14 am, \"Oskar Börjesson\" <notifications@github.com>\n> wrote:\n>\n> > How is the rewrite coming along? ☺️\n> >\n> > —\n> > You are receiving this because you authored the thread.\n> > Reply to this email directly, view it on GitHub\n> > <https://github.com/ds300/derivablejs/pull/37#issuecomment-266960696>,\n> or mute\n> > the thread\n> > <\n> https://github.com/notifications/unsubscribe-auth/ABL1qTkIsixvfwaiZ7S97VvPVB2q0_Mvks5rH5dygaJpZM4IOY1p\n> >\n> > .\n> >\n>\n> —\n> You are receiving this because you commented.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/ds300/derivablejs/pull/37#issuecomment-266981731>, or mute\n> the thread\n> <https://github.com/notifications/unsubscribe-auth/ABPNfWDu5rMCD8MiAFj587g2wiRxpZx6ks5rH7KWgaJpZM4IOY1p>\n> .\n>\n"}}
{"actor":{"display_login":"oskbor"}}