{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/c-rocksdb/issues/11","labels_url":"https://api.github.com/repos/cockroachdb/c-rocksdb/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/c-rocksdb/issues/11/comments","events_url":"https://api.github.com/repos/cockroachdb/c-rocksdb/issues/11/events","html_url":"https://github.com/cockroachdb/c-rocksdb/pull/11","id":114511870,"number":11,"title":"link in jemalloc","user":{"login":"tamird","id":1535036,"avatar_url":"https://avatars.githubusercontent.com/u/1535036?v=3","gravatar_id":"","url":"https://api.github.com/users/tamird","html_url":"https://github.com/tamird","followers_url":"https://api.github.com/users/tamird/followers","following_url":"https://api.github.com/users/tamird/following{/other_user}","gists_url":"https://api.github.com/users/tamird/gists{/gist_id}","starred_url":"https://api.github.com/users/tamird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamird/subscriptions","organizations_url":"https://api.github.com/users/tamird/orgs","repos_url":"https://api.github.com/users/tamird/repos","events_url":"https://api.github.com/users/tamird/events{/privacy}","received_events_url":"https://api.github.com/users/tamird/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-02T02:21:15Z","updated_at":"2015-11-03T01:01:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cockroachdb/c-rocksdb/pulls/11","html_url":"https://github.com/cockroachdb/c-rocksdb/pull/11","diff_url":"https://github.com/cockroachdb/c-rocksdb/pull/11.diff","patch_url":"https://github.com/cockroachdb/c-rocksdb/pull/11.patch"},"body":"I tested this in the main cockroach binary by printing the stats at exit:\r\n```diff\r\ndiff --git a/main.go b/main.go\r\nindex 0c22b74..fd51773 100644\r\n--- a/main.go\r\n+++ b/main.go\r\n@@ -24,10 +24,19 @@ import (\r\n \t\"math/rand\"\r\n \t\"os\"\r\n \r\n+\t_ \"github.com/cockroachdb/c-jemalloc\"\r\n+\r\n \t\"github.com/cockroachdb/cockroach/cli\"\r\n \t\"github.com/cockroachdb/cockroach/util/randutil\"\r\n )\r\n \r\n+// #cgo CPPFLAGS: -I../c-jemalloc/internal/include\r\n+// #cgo darwin LDFLAGS: -Wl,-undefined -Wl,dynamic_lookup\r\n+// #cgo !darwin LDFLAGS: -Wl,-unresolved-symbols=ignore-all\r\n+//\r\n+// #include <jemalloc/jemalloc.h>\r\n+import \"C\"\r\n+\r\n func main() {\r\n \t// Seed the math/rand RNG from crypto/rand.\r\n \trand.Seed(randutil.NewPseudoSeed())\r\n@@ -39,4 +48,6 @@ func main() {\r\n \t\tfmt.Fprintf(os.Stderr, \"Failed running command %q: %v\\n\", os.Args[1:], err)\r\n \t\tos.Exit(1)\r\n \t}\r\n+\r\n+\tC.malloc_stats_print(nil, nil, nil)\r\n }\r\n```\r\n\r\nHere are some results from the client and server after a short SQL session: https://gist.github.com/tamird/4dcdc6713ce8fb590cb2"},"comment":{"url":"https://api.github.com/repos/cockroachdb/c-rocksdb/issues/comments/153208227","html_url":"https://github.com/cockroachdb/c-rocksdb/pull/11#issuecomment-153208227","issue_url":"https://api.github.com/repos/cockroachdb/c-rocksdb/issues/11","id":153208227,"user":{"login":"petermattis","id":6201335,"avatar_url":"https://avatars.githubusercontent.com/u/6201335?v=3","gravatar_id":"","url":"https://api.github.com/users/petermattis","html_url":"https://github.com/petermattis","followers_url":"https://api.github.com/users/petermattis/followers","following_url":"https://api.github.com/users/petermattis/following{/other_user}","gists_url":"https://api.github.com/users/petermattis/gists{/gist_id}","starred_url":"https://api.github.com/users/petermattis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petermattis/subscriptions","organizations_url":"https://api.github.com/users/petermattis/orgs","repos_url":"https://api.github.com/users/petermattis/repos","events_url":"https://api.github.com/users/petermattis/events{/privacy}","received_events_url":"https://api.github.com/users/petermattis/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T01:01:03Z","updated_at":"2015-11-03T01:01:03Z","body":"There is some pretty crazy variation going on here. I'm hesitant to merge\nthis without understanding what is going on. Perhaps best to file an issue\nand link to this PR.\n\nOn Mon, Nov 2, 2015 at 5:12 PM, Tamir Duberstein <notifications@github.com>\nwrote:\n\n> Still quite a mixed bag. I ran -count 5 -benchtime 2s:\n>\n> name                                  old time/op    new time/op     delta\n> RPCSSLClientScan1Version1Row-4           375µs ±24%      389µs ±39%     ~     (p=0.841 n=5+5)\n> RPCSSLClientScan1Version10Rows-4         874µs ± 6%      941µs ±24%     ~     (p=0.222 n=5+5)\n> RPCSSLClientScan1Version100Rows-4       5.21ms ± 5%     4.84ms ± 9%     ~     (p=0.222 n=5+5)\n> RPCSSLClientScan1Version1000Rows-4      46.5ms ± 7%     39.3ms ±12%  -15.51%  (p=0.008 n=5+5)\n> RPCNoSSLClientScan1Version1Row-4         261µs ± 5%      248µs ±21%     ~     (p=0.222 n=5+5)\n> RPCNoSSLClientScan1Version10Rows-4       530µs ± 6%      486µs ± 8%     ~     (p=0.095 n=5+5)\n> RPCNoSSLClientScan1Version100Rows-4     3.16ms ±34%     2.36ms ± 9%  -25.54%  (p=0.008 n=5+5)\n> RPCNoSSLClientScan1Version1000Rows-4    20.7ms ± 4%     15.6ms ±34%     ~     (p=0.056 n=5+5)\n> TxnWrites-4                              471µs ± 2%      455µs ± 3%   -3.51%  (p=0.032 n=5+5)\n> Bank-4                                   908µs ± 4%      852µs ±10%     ~     (p=0.095 n=5+5)\n> Select1-4                                712µs ±31%      680µs ±23%     ~     (p=0.690 n=5+5)\n> WriteCmdNoEvents-4                       129µs ± 6%      124µs ± 5%     ~     (p=0.056 n=5+5)\n> WriteCmdWithEvents-4                     135µs ±13%      134µs ± 5%     ~     (p=0.841 n=5+5)\n> WriteCmdWithEventsAndConsumer-4          125µs ± 3%      137µs ± 0%  +10.14%  (p=0.016 n=5+4)\n> MVCCStats-4                             4.83µs ± 6%     4.99µs ± 5%     ~     (p=0.548 n=5+5)\n> MVCCScan1Version1Row-4                  9.75µs ± 8%    12.67µs ±18%  +29.89%  (p=0.016 n=5+5)\n> MVCCScan1Version10Rows-4                58.9µs ±10%     72.6µs ±14%  +23.26%  (p=0.016 n=5+5)\n> MVCCScan1Version100Rows-4                603µs ±11%      752µs ±10%  +24.62%  (p=0.008 n=5+5)\n> MVCCScan1Version1000Rows-4              6.93ms ± 7%     7.40ms ± 4%     ~     (p=0.095 n=5+5)\n> MVCCScan10Versions1Row-4                13.2µs ±19%    19.0µs ±128%     ~     (p=0.690 n=5+5)\n> MVCCScan10Versions10Rows-4              83.9µs ± 9%     80.9µs ±20%     ~     (p=0.841 n=5+5)\n> MVCCScan10Versions100Rows-4              666µs ±13%      763µs ±10%     ~     (p=0.056 n=5+5)\n> MVCCScan10Versions1000Rows-4            7.68ms ± 8%     6.66ms ±17%     ~     (p=0.151 n=5+5)\n> MVCCScan100Versions1Row-4               73.8µs ±59%     51.9µs ± 7%  -29.65%  (p=0.008 n=5+5)\n> MVCCScan100Versions10Rows-4              369µs ±28%      359µs ±15%     ~     (p=0.841 n=5+5)\n> MVCCScan100Versions100Rows-4            3.07ms ± 9%     2.94ms ± 3%     ~     (p=0.548 n=5+5)\n> MVCCScan100Versions1000Rows-4           35.2ms ±17%     29.9ms ± 5%     ~     (p=0.056 n=5+5)\n> MVCCGet1Version-4                       12.3µs ±36%      8.1µs ± 5%  -34.09%  (p=0.008 n=5+5)\n> MVCCGet10Versions-4                    22.4µs ±141%      8.5µs ±29%  -62.09%  (p=0.032 n=5+5)\n> MVCCGet100Versions-4                    47.2µs ± 9%     47.7µs ±19%     ~     (p=0.841 n=5+5)\n> MVCCPut10-4                             5.64µs ± 7%     5.48µs ± 9%     ~     (p=0.690 n=5+5)\n> MVCCPut100-4                            6.21µs ± 3%     6.22µs ±10%     ~     (p=0.690 n=5+5)\n> MVCCPut1000-4                           9.35µs ± 7%     7.94µs ± 3%  -15.06%  (p=0.008 n=5+5)\n> MVCCPut10000-4                          31.5µs ±10%     29.5µs ± 2%     ~     (p=0.151 n=5+5)\n> MVCCBatch1Put10-4                       6.15µs ± 6%     5.77µs ± 2%   -6.09%  (p=0.008 n=5+5)\n> MVCCBatch100Put10-4                     5.78µs ± 6%     5.46µs ± 7%     ~     (p=0.151 n=5+5)\n> MVCCBatch10000Put10-4                   6.84µs ± 6%     6.68µs ± 2%     ~     (p=0.222 n=5+5)\n> MVCCBatch100000Put10-4                  8.27µs ± 5%     7.70µs ± 3%   -6.88%  (p=0.008 n=5+5)\n> MVCCMergeTimeSeries-4                   8.56µs ± 4%     8.21µs ± 4%     ~     (p=0.056 n=5+5)\n>\n> name                                  old speed      new speed       delta\n> RPCSSLClientScan1Version1Row-4        2.77MB/s ±21%   2.75MB/s ±31%     ~     (p=0.841 n=5+5)\n> RPCSSLClientScan1Version10Rows-4      11.7MB/s ± 5%   11.1MB/s ±29%     ~     (p=0.222 n=5+5)\n> RPCSSLClientScan1Version100Rows-4     19.7MB/s ± 6%   21.3MB/s ±10%     ~     (p=0.222 n=5+5)\n> RPCSSLClientScan1Version1000Rows-4    22.0MB/s ± 6%   26.2MB/s ±11%  +18.93%  (p=0.008 n=5+5)\n> RPCNoSSLClientScan1Version1Row-4      3.93MB/s ± 5%   4.18MB/s ±18%     ~     (p=0.198 n=5+5)\n> RPCNoSSLClientScan1Version10Rows-4    19.4MB/s ± 6%   21.2MB/s ± 9%     ~     (p=0.095 n=5+5)\n> RPCNoSSLClientScan1Version100Rows-4   33.2MB/s ±27%   43.6MB/s ± 8%  +31.45%  (p=0.008 n=5+5)\n> RPCNoSSLClientScan1Version1000Rows-4  49.4MB/s ± 4%   67.3MB/s ±27%     ~     (p=0.056 n=5+5)\n> MVCCStats-4                           21.6MB/s ± 6%   20.9MB/s ± 6%     ~     (p=0.548 n=5+5)\n> MVCCScan1Version1Row-4                 105MB/s ± 8%     82MB/s ±21%  -22.50%  (p=0.016 n=5+5)\n> MVCCScan1Version10Rows-4               174MB/s ± 9%    142MB/s ±14%  -18.30%  (p=0.016 n=5+5)\n> MVCCScan1Version100Rows-4              170MB/s ±10%    137MB/s ±10%  -19.59%  (p=0.008 n=5+5)\n> MVCCScan1Version1000Rows-4             148MB/s ± 8%    138MB/s ± 4%     ~     (p=0.095 n=5+5)\n> MVCCScan10Versions1Row-4              78.1MB/s ±17%   74.9MB/s ±68%     ~     (p=0.690 n=5+5)\n> MVCCScan10Versions10Rows-4             123MB/s ± 9%    129MB/s ±23%     ~     (p=0.841 n=5+5)\n> MVCCScan10Versions100Rows-4            155MB/s ±12%    135MB/s ± 9%     ~     (p=0.056 n=5+5)\n> MVCCScan10Versions1000Rows-4           134MB/s ± 9%    156MB/s ±16%     ~     (p=0.151 n=5+5)\n> MVCCScan100Versions1Row-4             14.9MB/s ±41%   19.8MB/s ± 7%  +33.16%  (p=0.008 n=5+5)\n> MVCCScan100Versions10Rows-4           28.3MB/s ±23%   28.7MB/s ±14%     ~     (p=0.841 n=5+5)\n> MVCCScan100Versions100Rows-4          33.5MB/s ± 9%   34.8MB/s ± 3%     ~     (p=0.548 n=5+5)\n> MVCCScan100Versions1000Rows-4         29.6MB/s ±16%   34.3MB/s ± 5%     ~     (p=0.056 n=5+5)\n> MVCCGet1Version-4                     85.9MB/s ±29%  126.2MB/s ± 5%  +46.92%  (p=0.008 n=5+5)\n> MVCCGet10Versions-4                   68.3MB/s ±72%  123.0MB/s ±24%  +80.02%  (p=0.032 n=5+5)\n> MVCCGet100Versions-4                  21.8MB/s ±10%   21.7MB/s ±17%     ~     (p=0.841 n=5+5)\n> MVCCPut10-4                           1.78MB/s ± 7%   1.83MB/s ± 8%     ~     (p=0.651 n=5+5)\n> MVCCPut100-4                          16.1MB/s ± 3%   16.2MB/s ±11%     ~     (p=0.690 n=5+5)\n> MVCCPut1000-4                          107MB/s ± 7%    126MB/s ± 3%  +17.43%  (p=0.008 n=5+5)\n> MVCCPut10000-4                         319MB/s ±11%    339MB/s ± 2%     ~     (p=0.151 n=5+5)\n> MVCCBatch1Put10-4                     1.63MB/s ± 5%   1.73MB/s ± 2%   +6.51%  (p=0.008 n=5+5)\n> MVCCBatch100Put10-4                   1.74MB/s ± 7%   1.84MB/s ± 7%     ~     (p=0.167 n=5+5)\n> MVCCBatch10000Put10-4                 1.46MB/s ± 6%   1.50MB/s ± 2%     ~     (p=0.254 n=5+5)\n> MVCCBatch100000Put10-4                1.21MB/s ± 5%   1.30MB/s ± 3%   +7.45%  (p=0.016 n=5+5)\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/cockroachdb/c-rocksdb/pull/11#issuecomment-153174004>.\n>\n"}}