{"action":"created","comment":{"url":"https://api.github.com/repos/ripple/ripple-lib/pulls/comments/39573342","id":39573342,"diff_hunk":"@@ -1197,6 +1336,44 @@ OrderBook.prototype.computeAutobridgedOffers = function() {\n   this._offersAutobridged = autobridgeCalculator.calculate();\n };\n \n+OrderBook.prototype.computeAutobridgedOffersWrapper = function() {\n+  var startTime = Date.now();\n+  this.computeAutobridgedOffers();\n+  this.mergeDirectAndAutobridgedBooks();\n+  var lasted = (Date.now() - startTime);\n+  \n+  const newMult =\n+    ((lasted * 2 / OrderBook.AUTOBRIDGE_CALCULATE_THROTTLE_TIME) << 0) + 1;\n+  if (newMult !== this._autobridgeThrottleTimeMultiplier) {\n+    this._autobridgeThrottleTimeMultiplier = newMult;\n+    this.createDebouncedOffersWrapper();\n+  }\n+}\n+\n+OrderBook.prototype.createDebouncedOffersWrapper = function() {\n+  const m = this._autobridgeThrottleTimeMultiplier;\n+  this.computeAutobridgedOffersThrottled = \n+    _.debounce(","path":"src/orderbook.js","position":713,"original_position":713,"commit_id":"c745faaaf0956ca98448a754b4fe97fb50574fc7","original_commit_id":"c745faaaf0956ca98448a754b4fe97fb50574fc7","user":{"login":"shekenahglory","id":4000880,"avatar_url":"https://avatars.githubusercontent.com/u/4000880?v=3","gravatar_id":"","url":"https://api.github.com/users/shekenahglory","html_url":"https://github.com/shekenahglory","followers_url":"https://api.github.com/users/shekenahglory/followers","following_url":"https://api.github.com/users/shekenahglory/following{/other_user}","gists_url":"https://api.github.com/users/shekenahglory/gists{/gist_id}","starred_url":"https://api.github.com/users/shekenahglory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shekenahglory/subscriptions","organizations_url":"https://api.github.com/users/shekenahglory/orgs","repos_url":"https://api.github.com/users/shekenahglory/repos","events_url":"https://api.github.com/users/shekenahglory/events{/privacy}","received_events_url":"https://api.github.com/users/shekenahglory/received_events","type":"User","site_admin":false},"body":"right, it wouldn't be late, assuming the `ledger_closed` event triggered at the same time the batch of transactions came in.  The only latency would be a call needs to be made back to rippled to get the transactions instead of them streaming in","created_at":"2015-09-15T22:21:04Z","updated_at":"2015-09-15T22:21:04Z","html_url":"https://github.com/ripple/ripple-lib/pull/537#discussion_r39573342","pull_request_url":"https://api.github.com/repos/ripple/ripple-lib/pulls/537","_links":{"self":{"href":"https://api.github.com/repos/ripple/ripple-lib/pulls/comments/39573342"},"html":{"href":"https://github.com/ripple/ripple-lib/pull/537#discussion_r39573342"},"pull_request":{"href":"https://api.github.com/repos/ripple/ripple-lib/pulls/537"}}},"pull_request":{"url":"https://api.github.com/repos/ripple/ripple-lib/pulls/537","id":43822511,"html_url":"https://github.com/ripple/ripple-lib/pull/537","diff_url":"https://github.com/ripple/ripple-lib/pull/537.diff","patch_url":"https://github.com/ripple/ripple-lib/pull/537.patch","issue_url":"https://api.github.com/repos/ripple/ripple-lib/issues/537","number":537,"state":"closed","locked":false,"title":"Optimize performance (for 0.12 master branch)","user":{"login":"darkdarkdragon","id":2035357,"avatar_url":"https://avatars.githubusercontent.com/u/2035357?v=3","gravatar_id":"","url":"https://api.github.com/users/darkdarkdragon","html_url":"https://github.com/darkdarkdragon","followers_url":"https://api.github.com/users/darkdarkdragon/followers","following_url":"https://api.github.com/users/darkdarkdragon/following{/other_user}","gists_url":"https://api.github.com/users/darkdarkdragon/gists{/gist_id}","starred_url":"https://api.github.com/users/darkdarkdragon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darkdarkdragon/subscriptions","organizations_url":"https://api.github.com/users/darkdarkdragon/orgs","repos_url":"https://api.github.com/users/darkdarkdragon/repos","events_url":"https://api.github.com/users/darkdarkdragon/events{/privacy}","received_events_url":"https://api.github.com/users/darkdarkdragon/received_events","type":"User","site_admin":false},"body":"Optimize performance of OrderBook","created_at":"2015-08-31T23:32:01Z","updated_at":"2015-09-15T22:21:04Z","closed_at":"2015-09-11T00:04:16Z","merged_at":"2015-09-11T00:04:16Z","merge_commit_sha":"0e16daf3caf9480d3c19ee410076001c8dd72fc5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ripple/ripple-lib/pulls/537/commits","review_comments_url":"https://api.github.com/repos/ripple/ripple-lib/pulls/537/comments","review_comment_url":"https://api.github.com/repos/ripple/ripple-lib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ripple/ripple-lib/issues/537/comments","statuses_url":"https://api.github.com/repos/ripple/ripple-lib/statuses/c745faaaf0956ca98448a754b4fe97fb50574fc7","head":{"label":"darkdarkdragon:master-performance","ref":"master-performance","sha":"c745faaaf0956ca98448a754b4fe97fb50574fc7","user":{"login":"darkdarkdragon","id":2035357,"avatar_url":"https://avatars.githubusercontent.com/u/2035357?v=3","gravatar_id":"","url":"https://api.github.com/users/darkdarkdragon","html_url":"https://github.com/darkdarkdragon","followers_url":"https://api.github.com/users/darkdarkdragon/followers","following_url":"https://api.github.com/users/darkdarkdragon/following{/other_user}","gists_url":"https://api.github.com/users/darkdarkdragon/gists{/gist_id}","starred_url":"https://api.github.com/users/darkdarkdragon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darkdarkdragon/subscriptions","organizations_url":"https://api.github.com/users/darkdarkdragon/orgs","repos_url":"https://api.github.com/users/darkdarkdragon/repos","events_url":"https://api.github.com/users/darkdarkdragon/events{/privacy}","received_events_url":"https://api.github.com/users/darkdarkdragon/received_events","type":"User","site_admin":false},"repo":{"id":29372989,"name":"ripple-lib","full_name":"darkdarkdragon/ripple-lib","owner":{"login":"darkdarkdragon","id":2035357,"avatar_url":"https://avatars.githubusercontent.com/u/2035357?v=3","gravatar_id":"","url":"https://api.github.com/users/darkdarkdragon","html_url":"https://github.com/darkdarkdragon","followers_url":"https://api.github.com/users/darkdarkdragon/followers","following_url":"https://api.github.com/users/darkdarkdragon/following{/other_user}","gists_url":"https://api.github.com/users/darkdarkdragon/gists{/gist_id}","starred_url":"https://api.github.com/users/darkdarkdragon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darkdarkdragon/subscriptions","organizations_url":"https://api.github.com/users/darkdarkdragon/orgs","repos_url":"https://api.github.com/users/darkdarkdragon/repos","events_url":"https://api.github.com/users/darkdarkdragon/events{/privacy}","received_events_url":"https://api.github.com/users/darkdarkdragon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/darkdarkdragon/ripple-lib","description":"A JavaScript API for interacting with Ripple in Node.js and the browser","fork":true,"url":"https://api.github.com/repos/darkdarkdragon/ripple-lib","forks_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/forks","keys_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/teams","hooks_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/hooks","issue_events_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/issues/events{/number}","events_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/events","assignees_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/assignees{/user}","branches_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/branches{/branch}","tags_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/tags","blobs_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/languages","stargazers_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/stargazers","contributors_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/contributors","subscribers_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/subscribers","subscription_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/subscription","commits_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/contents/{+path}","compare_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/merges","archive_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/downloads","issues_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/issues{/number}","pulls_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/labels{/name}","releases_url":"https://api.github.com/repos/darkdarkdragon/ripple-lib/releases{/id}","created_at":"2015-01-16T23:42:55Z","updated_at":"2015-04-23T21:59:17Z","pushed_at":"2015-09-15T02:10:07Z","git_url":"git://github.com/darkdarkdragon/ripple-lib.git","ssh_url":"git@github.com:darkdarkdragon/ripple-lib.git","clone_url":"https://github.com/darkdarkdragon/ripple-lib.git","svn_url":"https://github.com/darkdarkdragon/ripple-lib","homepage":"","size":12439,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"develop"}},"base":{"label":"ripple:master","ref":"master","sha":"572c9452744a9e7ea862f425d7aee0e7bb9cc53a","user":{"login":"ripple","id":3165523,"avatar_url":"https://avatars.githubusercontent.com/u/3165523?v=3","gravatar_id":"","url":"https://api.github.com/users/ripple","html_url":"https://github.com/ripple","followers_url":"https://api.github.com/users/ripple/followers","following_url":"https://api.github.com/users/ripple/following{/other_user}","gists_url":"https://api.github.com/users/ripple/gists{/gist_id}","starred_url":"https://api.github.com/users/ripple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ripple/subscriptions","organizations_url":"https://api.github.com/users/ripple/orgs","repos_url":"https://api.github.com/users/ripple/repos","events_url":"https://api.github.com/users/ripple/events{/privacy}","received_events_url":"https://api.github.com/users/ripple/received_events","type":"Organization","site_admin":false},"repo":{"id":9681561,"name":"ripple-lib","full_name":"ripple/ripple-lib","owner":{"login":"ripple","id":3165523,"avatar_url":"https://avatars.githubusercontent.com/u/3165523?v=3","gravatar_id":"","url":"https://api.github.com/users/ripple","html_url":"https://github.com/ripple","followers_url":"https://api.github.com/users/ripple/followers","following_url":"https://api.github.com/users/ripple/following{/other_user}","gists_url":"https://api.github.com/users/ripple/gists{/gist_id}","starred_url":"https://api.github.com/users/ripple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ripple/subscriptions","organizations_url":"https://api.github.com/users/ripple/orgs","repos_url":"https://api.github.com/users/ripple/repos","events_url":"https://api.github.com/users/ripple/events{/privacy}","received_events_url":"https://api.github.com/users/ripple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ripple/ripple-lib","description":"A JavaScript API for interacting with Ripple in Node.js and the browser","fork":false,"url":"https://api.github.com/repos/ripple/ripple-lib","forks_url":"https://api.github.com/repos/ripple/ripple-lib/forks","keys_url":"https://api.github.com/repos/ripple/ripple-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ripple/ripple-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ripple/ripple-lib/teams","hooks_url":"https://api.github.com/repos/ripple/ripple-lib/hooks","issue_events_url":"https://api.github.com/repos/ripple/ripple-lib/issues/events{/number}","events_url":"https://api.github.com/repos/ripple/ripple-lib/events","assignees_url":"https://api.github.com/repos/ripple/ripple-lib/assignees{/user}","branches_url":"https://api.github.com/repos/ripple/ripple-lib/branches{/branch}","tags_url":"https://api.github.com/repos/ripple/ripple-lib/tags","blobs_url":"https://api.github.com/repos/ripple/ripple-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ripple/ripple-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ripple/ripple-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/ripple/ripple-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ripple/ripple-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/ripple/ripple-lib/languages","stargazers_url":"https://api.github.com/repos/ripple/ripple-lib/stargazers","contributors_url":"https://api.github.com/repos/ripple/ripple-lib/contributors","subscribers_url":"https://api.github.com/repos/ripple/ripple-lib/subscribers","subscription_url":"https://api.github.com/repos/ripple/ripple-lib/subscription","commits_url":"https://api.github.com/repos/ripple/ripple-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/ripple/ripple-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/ripple/ripple-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/ripple/ripple-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/ripple/ripple-lib/contents/{+path}","compare_url":"https://api.github.com/repos/ripple/ripple-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ripple/ripple-lib/merges","archive_url":"https://api.github.com/repos/ripple/ripple-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ripple/ripple-lib/downloads","issues_url":"https://api.github.com/repos/ripple/ripple-lib/issues{/number}","pulls_url":"https://api.github.com/repos/ripple/ripple-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/ripple/ripple-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/ripple/ripple-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ripple/ripple-lib/labels{/name}","releases_url":"https://api.github.com/repos/ripple/ripple-lib/releases{/id}","created_at":"2013-04-25T21:17:19Z","updated_at":"2015-09-15T12:37:26Z","pushed_at":"2015-09-15T22:06:14Z","git_url":"git://github.com/ripple/ripple-lib.git","ssh_url":"git@github.com:ripple/ripple-lib.git","clone_url":"https://github.com/ripple/ripple-lib.git","svn_url":"https://github.com/ripple/ripple-lib","homepage":"","size":18813,"stargazers_count":420,"watchers_count":420,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":154,"mirror_url":null,"open_issues_count":23,"forks":154,"open_issues":23,"watchers":420,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ripple/ripple-lib/pulls/537"},"html":{"href":"https://github.com/ripple/ripple-lib/pull/537"},"issue":{"href":"https://api.github.com/repos/ripple/ripple-lib/issues/537"},"comments":{"href":"https://api.github.com/repos/ripple/ripple-lib/issues/537/comments"},"review_comments":{"href":"https://api.github.com/repos/ripple/ripple-lib/pulls/537/comments"},"review_comment":{"href":"https://api.github.com/repos/ripple/ripple-lib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ripple/ripple-lib/pulls/537/commits"},"statuses":{"href":"https://api.github.com/repos/ripple/ripple-lib/statuses/c745faaaf0956ca98448a754b4fe97fb50574fc7"}}}}