{"action":"opened","issue":{"url":"https://api.github.com/repos/SitePen/dstore/issues/183","repository_url":"https://api.github.com/repos/SitePen/dstore","labels_url":"https://api.github.com/repos/SitePen/dstore/issues/183/labels{/name}","comments_url":"https://api.github.com/repos/SitePen/dstore/issues/183/comments","events_url":"https://api.github.com/repos/SitePen/dstore/issues/183/events","html_url":"https://github.com/SitePen/dstore/issues/183","id":155796691,"number":183,"title":"Questionable PutSync performance","user":{"login":"fedoranimus","id":179260,"avatar_url":"https://avatars.githubusercontent.com/u/179260?v=3","gravatar_id":"","url":"https://api.github.com/users/fedoranimus","html_url":"https://github.com/fedoranimus","followers_url":"https://api.github.com/users/fedoranimus/followers","following_url":"https://api.github.com/users/fedoranimus/following{/other_user}","gists_url":"https://api.github.com/users/fedoranimus/gists{/gist_id}","starred_url":"https://api.github.com/users/fedoranimus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedoranimus/subscriptions","organizations_url":"https://api.github.com/users/fedoranimus/orgs","repos_url":"https://api.github.com/users/fedoranimus/repos","events_url":"https://api.github.com/users/fedoranimus/events{/privacy}","received_events_url":"https://api.github.com/users/fedoranimus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-19T17:53:04Z","updated_at":"2016-05-19T17:53:04Z","closed_at":null,"body":"What are expectations for performance when adding new items to a store via `PutSync()` as opposed to updating existing items in a store via `PutSync()`?\r\n\r\nI've noticed a significant difference between the two, demonstrated by the following trivial code:\r\n\r\n```javascript\r\nlet testStore = new MemoryStore<any>({});\r\nconsole.time(\"addingData\");\r\nfor (let i = 0; i < 100000; i++) {\r\n    testStore.putSync({id: i, value: i});\r\n}\r\nconsole.timeEnd(\"addingData\");\r\nconsole.time(\"puttingData\");\r\nfor (let i = 0; i < 100000; i++) {\r\n     testStore.putSync({ id: i, value: i });\r\n}\r\nconsole.timeEnd(\"puttingData\");\r\n```\r\nThe following times are returned:\r\n```\r\naddingData: 430.055ms (~.5s)\r\nputtingData: 257644.077ms (~4.3min)\r\n```\r\nIs such a significant difference expected?"}}