GitHub PullRequestReviewCommentEvent at 2014-03-28 16:08:21
Repository: HPCC-Platform
Actor: jakesmith
Payload: {"comment":{"url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/comments/11072523","id":11072523,"diff_hunk":"@@ -17271,6 +17284,110 @@ class CRoxieServerLookupJoinActivity : public CRoxieServerTwoInputActivity\n         static unsigned const BadIndex;\n     };\n \n+    class ManyLookupTable : public LookupTable\n+    {\n+    public:\n+        ManyLookupTable(ConstPointerArray &rightRows, IHThorHashJoinArg &helper)\n+        : LookupTable(helper)\n+        {\n+            rightRows.swapWith(rowtable);\n+            UInt64Array groups;\n+            unsigned numRows = rowtable.length();\n+            if (rowtable.length())\n+            {\n+                unsigned groupStart = 0;\n+                const void *groupStartRow = rowtable.item(0);\n+                for(unsigned i=1; i < numRows; i++)\n+                {\n+                    const void *thisRow = rowtable.item(i);\n+                    if (rightCompare->docompare(groupStartRow, thisRow))\n+                    {\n+                        groups.append(makeint64(groupStart, i-groupStart));\n+                        groupStart = i;\n+                        groupStartRow = thisRow;\n+                    }\n+                }\n+                groups.append(makeint64(groupStart, numRows-groupStart));\n+            }\n+            unsigned minsize = (4*groups.length())/3;\n+            size = 2;\n+            while((minsize >>= 1) > 0)\n+                size <<= 1;\n+            mask = size - 1;\n+            table = (__uint64 *) calloc(size, sizeof(__uint64));\n+            ForEachItemIn(idx, groups)\n+            {\n+                unsigned __int64 group = groups.item(idx);\n+                unsigned groupstart = high(group);\n+                unsigned grouplen = low(group);\n+                const void *row = rowtable.item(groupstart);\n+                add(row, group);\n+            }\n+        }\n+\n+        ~ManyLookupTable()\n+        {\n+            ForEachItemIn(idx, rowtable)\n+            {\n+                ReleaseRoxieRow(rowtable.item(idx));\n+            }\n+            free(table);\n+        }\n+\n+        void add(const void *row, unsigned __int64 group)\n+        {\n+            unsigned start = rightHash->hash(row) & mask;","path":"roxie/ccd/ccdserver.cpp","position":147,"original_position":147,"commit_id":"fb0318b2b414fad912d8c425856ed3a23ba4a432","original_commit_id":"fb0318b2b414fad912d8c425856ed3a23ba4a432","user":{"login":"jakesmith","id":902700,"avatar_url":"https://avatars.githubusercontent.com/u/902700?","gravatar_id":"8eff4f840b1605e58ce34b0c3b5eea5a","url":"https://api.github.com/users/jakesmith","html_url":"https://github.com/jakesmith","followers_url":"https://api.github.com/users/jakesmith/followers","following_url":"https://api.github.com/users/jakesmith/following{/other_user}","gists_url":"https://api.github.com/users/jakesmith/gists{/gist_id}","starred_url":"https://api.github.com/users/jakesmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakesmith/subscriptions","organizations_url":"https://api.github.com/users/jakesmith/orgs","repos_url":"https://api.github.com/users/jakesmith/repos","events_url":"https://api.github.com/users/jakesmith/events{/privacy}","received_events_url":"https://api.github.com/users/jakesmith/received_events","type":"User","site_admin":false},"body":"I also doubt it is, the main cost here is the compare function in the find.","created_at":"2014-03-28T16:08:21Z","updated_at":"2014-03-28T16:08:21Z","html_url":"https://github.com/hpcc-systems/HPCC-Platform/pull/5579#discussion_r11072523","pull_request_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/5579","_links":{"self":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/comments/11072523"},"html":{"href":"https://github.com/hpcc-systems/HPCC-Platform/pull/5579#discussion_r11072523"},"pull_request":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/5579"}}}}