{"action":"created","comment":{"url":"https://api.github.com/repos/Eyescale/Pression/pulls/comments/87362961","pull_request_review_id":7969593,"id":87362961,"diff_hunk":"@@ -0,0 +1,88 @@\n+\n+/* Copyright (c) 2016, Stefan.Eilemann@epfl.ch\n+ *\n+ * This file is part of Collage <https://github.com/Eyescale/Collage>\n+ *\n+ * This library is free software; you can redistribute it and/or modify it under\n+ * the terms of the GNU Lesser General Public License version 2.1 as published\n+ * by the Free Software Foundation.\n+ *\n+ * This library is distributed in the hope that it will be useful, but WITHOUT\n+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n+ * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more\n+ * details.\n+ *\n+ * You should have received a copy of the GNU Lesser General Public License\n+ * along with this library; if not, write to the Free Software Foundation, Inc.,\n+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n+ */\n+\n+#include \"Registry.h\"\n+\n+#include \"Compressor.h\"\n+\n+namespace pression\n+{\n+namespace data\n+{\n+\n+class Registry::Impl\n+{\n+public:\n+    Impl() {}\n+    ~Impl(){}\n+\n+    CompressorInfos compressorInfos;\n+};\n+\n+Registry& Registry::getInstance()\n+{\n+    static Registry _instance;\n+    return _instance;\n+}\n+\n+Registry::Registry()\n+    : _impl( new Registry::Impl )\n+{}\n+\n+Registry::~Registry()\n+{}\n+\n+bool Registry::_registerEngine( const CompressorInfo& info )\n+{\n+    _impl->compressorInfos.push_back( info );\n+    return true;\n+}\n+\n+const CompressorInfos& Registry::getInfos() const\n+{\n+    return _impl->compressorInfos;\n+}\n+\n+CompressorInfo Registry::choose()\n+{\n+    CompressorInfo candidate;\n+    float rating = powf( 1.0f, .3f );\n+\n+    for( const CompressorInfo& info : _impl->compressorInfos )\n+    {\n+        float newRating = powf( info.speed, .3f ) / info.ratio;\n+        if( newRating > rating )\n+        {\n+            candidate = info;\n+            rating = newRating;\n+        }\n+    }\n+    return candidate;\n+}\n+\n+CompressorInfo Registry::find( const std::string& name )\n+{\n+    for( const CompressorInfo& info : _impl->compressorInfos )","path":"pression/data/Registry.cpp","position":81,"original_position":81,"commit_id":"3101b057aa15c85fc3e0f725b97e40d1e93aaf64","original_commit_id":"3101b057aa15c85fc3e0f725b97e40d1e93aaf64","user":{"login":"hernando","id":791427,"avatar_url":"https://avatars.githubusercontent.com/u/791427?v=3","gravatar_id":"","url":"https://api.github.com/users/hernando","html_url":"https://github.com/hernando","followers_url":"https://api.github.com/users/hernando/followers","following_url":"https://api.github.com/users/hernando/following{/other_user}","gists_url":"https://api.github.com/users/hernando/gists{/gist_id}","starred_url":"https://api.github.com/users/hernando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hernando/subscriptions","organizations_url":"https://api.github.com/users/hernando/orgs","repos_url":"https://api.github.com/users/hernando/repos","events_url":"https://api.github.com/users/hernando/events{/privacy}","received_events_url":"https://api.github.com/users/hernando/received_events","type":"User","site_admin":false},"body":"same here","created_at":"2016-11-10T10:07:25Z","updated_at":"2016-11-10T10:10:25Z","html_url":"https://github.com/Eyescale/Pression/pull/23#discussion_r87362961","pull_request_url":"https://api.github.com/repos/Eyescale/Pression/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/Eyescale/Pression/pulls/comments/87362961"},"html":{"href":"https://github.com/Eyescale/Pression/pull/23#discussion_r87362961"},"pull_request":{"href":"https://api.github.com/repos/Eyescale/Pression/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/Eyescale/Pression/pulls/23","id":92151608,"html_url":"https://github.com/Eyescale/Pression/pull/23","diff_url":"https://github.com/Eyescale/Pression/pull/23.diff","patch_url":"https://github.com/Eyescale/Pression/pull/23.patch","issue_url":"https://api.github.com/repos/Eyescale/Pression/issues/23","number":23,"state":"open","locked":false,"title":"Data compression v2 implementation","user":{"login":"eile","id":354947,"avatar_url":"https://avatars.githubusercontent.com/u/354947?v=3","gravatar_id":"","url":"https://api.github.com/users/eile","html_url":"https://github.com/eile","followers_url":"https://api.github.com/users/eile/followers","following_url":"https://api.github.com/users/eile/following{/other_user}","gists_url":"https://api.github.com/users/eile/gists{/gist_id}","starred_url":"https://api.github.com/users/eile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eile/subscriptions","organizations_url":"https://api.github.com/users/eile/orgs","repos_url":"https://api.github.com/users/eile/repos","events_url":"https://api.github.com/users/eile/events{/privacy}","received_events_url":"https://api.github.com/users/eile/received_events","type":"User","site_admin":false},"body":"See #22 for spec. New features:\r\n* Parallel compression for all engines\r\n* CompressorZSTD with different compression levels\r\n","created_at":"2016-11-03T13:21:18Z","updated_at":"2016-11-10T10:10:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ce52637e15610fd78e33d0ec25ea82e1fda70c57","assignee":{"login":"hernando","id":791427,"avatar_url":"https://avatars.githubusercontent.com/u/791427?v=3","gravatar_id":"","url":"https://api.github.com/users/hernando","html_url":"https://github.com/hernando","followers_url":"https://api.github.com/users/hernando/followers","following_url":"https://api.github.com/users/hernando/following{/other_user}","gists_url":"https://api.github.com/users/hernando/gists{/gist_id}","starred_url":"https://api.github.com/users/hernando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hernando/subscriptions","organizations_url":"https://api.github.com/users/hernando/orgs","repos_url":"https://api.github.com/users/hernando/repos","events_url":"https://api.github.com/users/hernando/events{/privacy}","received_events_url":"https://api.github.com/users/hernando/received_events","type":"User","site_admin":false},"assignees":[{"login":"hernando","id":791427,"avatar_url":"https://avatars.githubusercontent.com/u/791427?v=3","gravatar_id":"","url":"https://api.github.com/users/hernando","html_url":"https://github.com/hernando","followers_url":"https://api.github.com/users/hernando/followers","following_url":"https://api.github.com/users/hernando/following{/other_user}","gists_url":"https://api.github.com/users/hernando/gists{/gist_id}","starred_url":"https://api.github.com/users/hernando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hernando/subscriptions","organizations_url":"https://api.github.com/users/hernando/orgs","repos_url":"https://api.github.com/users/hernando/repos","events_url":"https://api.github.com/users/hernando/events{/privacy}","received_events_url":"https://api.github.com/users/hernando/received_events","type":"User","site_admin":false},{"login":"rdumusc","id":5166658,"avatar_url":"https://avatars.githubusercontent.com/u/5166658?v=3","gravatar_id":"","url":"https://api.github.com/users/rdumusc","html_url":"https://github.com/rdumusc","followers_url":"https://api.github.com/users/rdumusc/followers","following_url":"https://api.github.com/users/rdumusc/following{/other_user}","gists_url":"https://api.github.com/users/rdumusc/gists{/gist_id}","starred_url":"https://api.github.com/users/rdumusc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdumusc/subscriptions","organizations_url":"https://api.github.com/users/rdumusc/orgs","repos_url":"https://api.github.com/users/rdumusc/repos","events_url":"https://api.github.com/users/rdumusc/events{/privacy}","received_events_url":"https://api.github.com/users/rdumusc/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Eyescale/Pression/pulls/23/commits","review_comments_url":"https://api.github.com/repos/Eyescale/Pression/pulls/23/comments","review_comment_url":"https://api.github.com/repos/Eyescale/Pression/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Eyescale/Pression/issues/23/comments","statuses_url":"https://api.github.com/repos/Eyescale/Pression/statuses/3101b057aa15c85fc3e0f725b97e40d1e93aaf64","head":{"label":"eile:data","ref":"data","sha":"3101b057aa15c85fc3e0f725b97e40d1e93aaf64","user":{"login":"eile","id":354947,"avatar_url":"https://avatars.githubusercontent.com/u/354947?v=3","gravatar_id":"","url":"https://api.github.com/users/eile","html_url":"https://github.com/eile","followers_url":"https://api.github.com/users/eile/followers","following_url":"https://api.github.com/users/eile/following{/other_user}","gists_url":"https://api.github.com/users/eile/gists{/gist_id}","starred_url":"https://api.github.com/users/eile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eile/subscriptions","organizations_url":"https://api.github.com/users/eile/orgs","repos_url":"https://api.github.com/users/eile/repos","events_url":"https://api.github.com/users/eile/events{/privacy}","received_events_url":"https://api.github.com/users/eile/received_events","type":"User","site_admin":false},"repo":{"id":30237863,"name":"Pression","full_name":"eile/Pression","owner":{"login":"eile","id":354947,"avatar_url":"https://avatars.githubusercontent.com/u/354947?v=3","gravatar_id":"","url":"https://api.github.com/users/eile","html_url":"https://github.com/eile","followers_url":"https://api.github.com/users/eile/followers","following_url":"https://api.github.com/users/eile/following{/other_user}","gists_url":"https://api.github.com/users/eile/gists{/gist_id}","starred_url":"https://api.github.com/users/eile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eile/subscriptions","organizations_url":"https://api.github.com/users/eile/orgs","repos_url":"https://api.github.com/users/eile/repos","events_url":"https://api.github.com/users/eile/events{/privacy}","received_events_url":"https://api.github.com/users/eile/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eile/Pression","description":"Compression and data transfer plugins","fork":true,"url":"https://api.github.com/repos/eile/Pression","forks_url":"https://api.github.com/repos/eile/Pression/forks","keys_url":"https://api.github.com/repos/eile/Pression/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eile/Pression/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eile/Pression/teams","hooks_url":"https://api.github.com/repos/eile/Pression/hooks","issue_events_url":"https://api.github.com/repos/eile/Pression/issues/events{/number}","events_url":"https://api.github.com/repos/eile/Pression/events","assignees_url":"https://api.github.com/repos/eile/Pression/assignees{/user}","branches_url":"https://api.github.com/repos/eile/Pression/branches{/branch}","tags_url":"https://api.github.com/repos/eile/Pression/tags","blobs_url":"https://api.github.com/repos/eile/Pression/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eile/Pression/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eile/Pression/git/refs{/sha}","trees_url":"https://api.github.com/repos/eile/Pression/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eile/Pression/statuses/{sha}","languages_url":"https://api.github.com/repos/eile/Pression/languages","stargazers_url":"https://api.github.com/repos/eile/Pression/stargazers","contributors_url":"https://api.github.com/repos/eile/Pression/contributors","subscribers_url":"https://api.github.com/repos/eile/Pression/subscribers","subscription_url":"https://api.github.com/repos/eile/Pression/subscription","commits_url":"https://api.github.com/repos/eile/Pression/commits{/sha}","git_commits_url":"https://api.github.com/repos/eile/Pression/git/commits{/sha}","comments_url":"https://api.github.com/repos/eile/Pression/comments{/number}","issue_comment_url":"https://api.github.com/repos/eile/Pression/issues/comments{/number}","contents_url":"https://api.github.com/repos/eile/Pression/contents/{+path}","compare_url":"https://api.github.com/repos/eile/Pression/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eile/Pression/merges","archive_url":"https://api.github.com/repos/eile/Pression/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eile/Pression/downloads","issues_url":"https://api.github.com/repos/eile/Pression/issues{/number}","pulls_url":"https://api.github.com/repos/eile/Pression/pulls{/number}","milestones_url":"https://api.github.com/repos/eile/Pression/milestones{/number}","notifications_url":"https://api.github.com/repos/eile/Pression/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eile/Pression/labels{/name}","releases_url":"https://api.github.com/repos/eile/Pression/releases{/id}","deployments_url":"https://api.github.com/repos/eile/Pression/deployments","created_at":"2015-02-03T10:40:12Z","updated_at":"2016-02-16T14:35:18Z","pushed_at":"2016-11-10T09:45:08Z","git_url":"git://github.com/eile/Pression.git","ssh_url":"git@github.com:eile/Pression.git","clone_url":"https://github.com/eile/Pression.git","svn_url":"https://github.com/eile/Pression","homepage":null,"size":420,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Eyescale:master","ref":"master","sha":"3d5cc3a2934179bd21d6fabbe0052d87b4e6aab0","user":{"login":"Eyescale","id":354955,"avatar_url":"https://avatars.githubusercontent.com/u/354955?v=3","gravatar_id":"","url":"https://api.github.com/users/Eyescale","html_url":"https://github.com/Eyescale","followers_url":"https://api.github.com/users/Eyescale/followers","following_url":"https://api.github.com/users/Eyescale/following{/other_user}","gists_url":"https://api.github.com/users/Eyescale/gists{/gist_id}","starred_url":"https://api.github.com/users/Eyescale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eyescale/subscriptions","organizations_url":"https://api.github.com/users/Eyescale/orgs","repos_url":"https://api.github.com/users/Eyescale/repos","events_url":"https://api.github.com/users/Eyescale/events{/privacy}","received_events_url":"https://api.github.com/users/Eyescale/received_events","type":"Organization","site_admin":false},"repo":{"id":27916172,"name":"Pression","full_name":"Eyescale/Pression","owner":{"login":"Eyescale","id":354955,"avatar_url":"https://avatars.githubusercontent.com/u/354955?v=3","gravatar_id":"","url":"https://api.github.com/users/Eyescale","html_url":"https://github.com/Eyescale","followers_url":"https://api.github.com/users/Eyescale/followers","following_url":"https://api.github.com/users/Eyescale/following{/other_user}","gists_url":"https://api.github.com/users/Eyescale/gists{/gist_id}","starred_url":"https://api.github.com/users/Eyescale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eyescale/subscriptions","organizations_url":"https://api.github.com/users/Eyescale/orgs","repos_url":"https://api.github.com/users/Eyescale/repos","events_url":"https://api.github.com/users/Eyescale/events{/privacy}","received_events_url":"https://api.github.com/users/Eyescale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Eyescale/Pression","description":"Compression and data transfer plugins","fork":false,"url":"https://api.github.com/repos/Eyescale/Pression","forks_url":"https://api.github.com/repos/Eyescale/Pression/forks","keys_url":"https://api.github.com/repos/Eyescale/Pression/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Eyescale/Pression/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Eyescale/Pression/teams","hooks_url":"https://api.github.com/repos/Eyescale/Pression/hooks","issue_events_url":"https://api.github.com/repos/Eyescale/Pression/issues/events{/number}","events_url":"https://api.github.com/repos/Eyescale/Pression/events","assignees_url":"https://api.github.com/repos/Eyescale/Pression/assignees{/user}","branches_url":"https://api.github.com/repos/Eyescale/Pression/branches{/branch}","tags_url":"https://api.github.com/repos/Eyescale/Pression/tags","blobs_url":"https://api.github.com/repos/Eyescale/Pression/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Eyescale/Pression/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Eyescale/Pression/git/refs{/sha}","trees_url":"https://api.github.com/repos/Eyescale/Pression/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Eyescale/Pression/statuses/{sha}","languages_url":"https://api.github.com/repos/Eyescale/Pression/languages","stargazers_url":"https://api.github.com/repos/Eyescale/Pression/stargazers","contributors_url":"https://api.github.com/repos/Eyescale/Pression/contributors","subscribers_url":"https://api.github.com/repos/Eyescale/Pression/subscribers","subscription_url":"https://api.github.com/repos/Eyescale/Pression/subscription","commits_url":"https://api.github.com/repos/Eyescale/Pression/commits{/sha}","git_commits_url":"https://api.github.com/repos/Eyescale/Pression/git/commits{/sha}","comments_url":"https://api.github.com/repos/Eyescale/Pression/comments{/number}","issue_comment_url":"https://api.github.com/repos/Eyescale/Pression/issues/comments{/number}","contents_url":"https://api.github.com/repos/Eyescale/Pression/contents/{+path}","compare_url":"https://api.github.com/repos/Eyescale/Pression/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Eyescale/Pression/merges","archive_url":"https://api.github.com/repos/Eyescale/Pression/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Eyescale/Pression/downloads","issues_url":"https://api.github.com/repos/Eyescale/Pression/issues{/number}","pulls_url":"https://api.github.com/repos/Eyescale/Pression/pulls{/number}","milestones_url":"https://api.github.com/repos/Eyescale/Pression/milestones{/number}","notifications_url":"https://api.github.com/repos/Eyescale/Pression/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Eyescale/Pression/labels{/name}","releases_url":"https://api.github.com/repos/Eyescale/Pression/releases{/id}","deployments_url":"https://api.github.com/repos/Eyescale/Pression/deployments","created_at":"2014-12-12T10:35:12Z","updated_at":"2016-11-10T01:17:24Z","pushed_at":"2016-11-10T09:45:09Z","git_url":"git://github.com/Eyescale/Pression.git","ssh_url":"git@github.com:Eyescale/Pression.git","clone_url":"https://github.com/Eyescale/Pression.git","svn_url":"https://github.com/Eyescale/Pression","homepage":"https://eyescale.github.io","size":428,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":1,"forks":5,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Eyescale/Pression/pulls/23"},"html":{"href":"https://github.com/Eyescale/Pression/pull/23"},"issue":{"href":"https://api.github.com/repos/Eyescale/Pression/issues/23"},"comments":{"href":"https://api.github.com/repos/Eyescale/Pression/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/Eyescale/Pression/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/Eyescale/Pression/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Eyescale/Pression/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/Eyescale/Pression/statuses/3101b057aa15c85fc3e0f725b97e40d1e93aaf64"}}}}
{"actor":{"display_login":"hernando"}}