{"action":"created","issue":{"url":"https://api.github.com/repos/spullara/interviewcode/issues/6","repository_url":"https://api.github.com/repos/spullara/interviewcode","labels_url":"https://api.github.com/repos/spullara/interviewcode/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/spullara/interviewcode/issues/6/comments","events_url":"https://api.github.com/repos/spullara/interviewcode/issues/6/events","html_url":"https://github.com/spullara/interviewcode/pull/6","id":394826607,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxNDY1MTMy","number":6,"title":"Fix memory leaks and get rid of redundant copies.","user":{"login":"kaushiks","id":117491,"node_id":"MDQ6VXNlcjExNzQ5MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/117491?v=4","gravatar_id":"","url":"https://api.github.com/users/kaushiks","html_url":"https://github.com/kaushiks","followers_url":"https://api.github.com/users/kaushiks/followers","following_url":"https://api.github.com/users/kaushiks/following{/other_user}","gists_url":"https://api.github.com/users/kaushiks/gists{/gist_id}","starred_url":"https://api.github.com/users/kaushiks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaushiks/subscriptions","organizations_url":"https://api.github.com/users/kaushiks/orgs","repos_url":"https://api.github.com/users/kaushiks/repos","events_url":"https://api.github.com/users/kaushiks/events{/privacy}","received_events_url":"https://api.github.com/users/kaushiks/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-12-29T21:38:36Z","updated_at":"2018-12-29T22:20:05Z","closed_at":"2018-12-29T21:51:56Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/spullara/interviewcode/pulls/6","html_url":"https://github.com/spullara/interviewcode/pull/6","diff_url":"https://github.com/spullara/interviewcode/pull/6.diff","patch_url":"https://github.com/spullara/interviewcode/pull/6.patch"},"body":"Results in a ~ 50% speedup. Also narrows the gap between libc++'s malloc and jemalloc to ~ 15% that sounds about right to me.\r\n\r\n```\r\ntw-mbp-ks:interviewcodecpp kaushik$ CXXFLAGS=\"-std=c++11 -O2\" make main\r\nc++ -std=c++11 -O2    main.cpp   -o main\r\ntw-mbp-ks:interviewcodecpp kaushik$ ./main\r\nStarting\r\nRunning benchmark\r\n300 ns/op\r\n295 ns/op\r\n297 ns/op\r\n294 ns/op\r\n296 ns/op\r\ntw-mbp-ks:interviewcodecpp kaushik$ DYLD_INSERT_LIBRARIES=/usr/local/lib/libjemalloc.2.dylib ./main\r\nStarting\r\nRunning benchmark\r\n256 ns/op\r\n251 ns/op\r\n249 ns/op\r\n258 ns/op\r\n256 ns/op\r\ntw-mbp-ks:interviewcodecpp kaushik$ valgrind ./main\r\n==43739== Memcheck, a memory error detector\r\n==43739== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.\r\n==43739== Using Valgrind-3.15.0.GIT and LibVEX; rerun with -h for copyright info\r\n==43739== Command: ./main\r\n==43739== \r\n--43739-- run: /usr/bin/dsymutil \"./main\"\r\nwarning: no debug symbols in executable (-arch x86_64)\r\nStarting\r\nRunning benchmark\r\n7982 ns/op\r\n8006 ns/op\r\n8044 ns/op\r\n7930 ns/op\r\n7947 ns/op\r\n==43739== \r\n==43739== HEAP SUMMARY:\r\n==43739==     in use at exit: 22,480 bytes in 163 blocks\r\n==43739==   total heap usage: 5,017,519 allocs, 5,017,356 frees, 5,361,546,256 bytes allocated\r\n==43739== \r\n==43739== LEAK SUMMARY:\r\n==43739==    definitely lost: 0 bytes in 0 blocks\r\n==43739==    indirectly lost: 0 bytes in 0 blocks\r\n==43739==      possibly lost: 72 bytes in 3 blocks\r\n==43739==    still reachable: 4,296 bytes in 7 blocks\r\n==43739==         suppressed: 18,112 bytes in 153 blocks\r\n==43739== Rerun with --leak-check=full to see details of leaked memory\r\n==43739== \r\n==43739== For lists of detected and suppressed errors, rerun with: -s\r\n==43739== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 1 from 1)\r\n```"},"comment":{"url":"https://api.github.com/repos/spullara/interviewcode/issues/comments/450524295","html_url":"https://github.com/spullara/interviewcode/pull/6#issuecomment-450524295","issue_url":"https://api.github.com/repos/spullara/interviewcode/issues/6","id":450524295,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDUyNDI5NQ==","user":{"login":"kaushiks","id":117491,"node_id":"MDQ6VXNlcjExNzQ5MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/117491?v=4","gravatar_id":"","url":"https://api.github.com/users/kaushiks","html_url":"https://github.com/kaushiks","followers_url":"https://api.github.com/users/kaushiks/followers","following_url":"https://api.github.com/users/kaushiks/following{/other_user}","gists_url":"https://api.github.com/users/kaushiks/gists{/gist_id}","starred_url":"https://api.github.com/users/kaushiks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaushiks/subscriptions","organizations_url":"https://api.github.com/users/kaushiks/orgs","repos_url":"https://api.github.com/users/kaushiks/repos","events_url":"https://api.github.com/users/kaushiks/events{/privacy}","received_events_url":"https://api.github.com/users/kaushiks/received_events","type":"User","site_admin":false},"created_at":"2018-12-29T22:20:05Z","updated_at":"2018-12-29T22:20:05Z","author_association":"CONTRIBUTOR","body":"in createEntriesList, is the assumption that there could be duplicate entities? Is that why you used a set? (and are now recommending an unordered_set?). If not, theoretically, could it also be a vector<vector<Entity>>?"}}
{"actor":{"display_login":"kaushiks"}}