Title: Transfer progress notifications are prohibitively slow · Issue #919 · nodegit/nodegit · GitHub
Open Graph Title: Transfer progress notifications are prohibitively slow · Issue #919 · nodegit/nodegit
X Title: Transfer progress notifications are prohibitively slow · Issue #919 · nodegit/nodegit
Description: Having even an empty transfer progress function for fetches adds a large amount of overhead. In the code below, for example, on the nodegit repo itself, specifying a transfer progress function adds about 38s for me. The progress function...
Open Graph Description: Having even an empty transfer progress function for fetches adds a large amount of overhead. In the code below, for example, on the nodegit repo itself, specifying a transfer progress function adds...
X Description: Having even an empty transfer progress function for fetches adds a large amount of overhead. In the code below, for example, on the nodegit repo itself, specifying a transfer progress function adds...
Opengraph URL: https://github.com/nodegit/nodegit/issues/919
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Transfer progress notifications are prohibitively slow","articleBody":"Having even an empty transfer progress function for fetches adds a large amount of overhead. In the code below, for example, on the nodegit repo itself, specifying a transfer progress function adds about 38s for me.\n\nThe progress function is called once for each object fetched from the repository: about 25,000 times for the nodegit repo as of today. That would indicate an overhead of about 1.5ms for calling from C++ into JavaScript (running on a 3.1ghz i7). This amount of overhead feels a little high; I wonder if there might be some room for optimizing the JS/C++ binding/bridge code.\n\nEven if significantly optimized (e.g., by a factor of 10), the overhead of calling from C++ into JS is probably high enough to be prohibitive; it might be good to be able to provide some conflation so that the progress function is called no more than a specified frequency (e.g., no more than once every 100ms).\n\nIf no one has an easy answer for this, I would be more than happy to lend a hand (I have a lot of experience with v8).\n\nSample code:\n\n```\nconst NodeGit = require(\"nodegit\");\n\nconsole.time(\"no-progress\");\n\nNodeGit.Clone(\"https://github.com/nodegit/nodegit.git\", \"no-progress\")\n.then(function () {\n console.timeEnd(\"no-progress\");\n console.time(\"progress\");\n var options = new NodeGit.CloneOptions();\n var fetchOpts = new NodeGit.FetchOptions();\n options.fetchOpts = fetchOpts;\n var callbacks = new NodeGit.RemoteCallbacks();\n fetchOpts.callbacks = callbacks;\n callbacks.transferProgress = function () {\n };\n return NodeGit.Clone(\"https://github.com/nodegit/nodegit.git\",\n \"progress\",\n options);\n}).done(function () {\n console.timeEnd(\"progress\");\n process.exit(0);\n});\n```\n","author":{"url":"https://github.com/bpeabody","@type":"Person","name":"bpeabody"},"datePublished":"2016-02-24T20:26:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/919/nodegit/issues/919"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bca37e96-8343-4852-cf16-633eb579dad1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A5C0:1C859A:109A8A:15C742:6A5FE74F |
| html-safe-nonce | 2c93d91ac4aedcc9906e5e89daf6397c48f779c455ea5c1252d883657ec402bc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUMwOjFDODU5QToxMDlBOEE6MTVDNzQyOjZBNUZFNzRGIiwidmlzaXRvcl9pZCI6IjQwMDc5OTkyMzgyOTEwNTY0NjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 12c580c711e6ffdffcc247ba43328f581ca467fd206695ef600007ae44b29c68 |
| hovercard-subject-tag | issue:136177369 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodegit/nodegit/919/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c8206cc7367198c9cd5de96903334de10e9bff9eab6e3dfe0def92587a0f99e2/nodegit/nodegit/issues/919 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c8206cc7367198c9cd5de96903334de10e9bff9eab6e3dfe0def92587a0f99e2/nodegit/nodegit/issues/919 |
| og:image:alt | Having even an empty transfer progress function for fetches adds a large amount of overhead. In the code below, for example, on the nodegit repo itself, specifying a transfer progress function adds... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bpeabody |
| hostname | github.com |
| expected-hostname | github.com |
| None | 78938542173c0d8e4ad1aefc7954896e81c10ce2620286603ef14cf593bd5a11 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodegit/nodegit git https://github.com/nodegit/nodegit.git |
| octolytics-dimension-user_id | 657068 |
| octolytics-dimension-user_login | nodegit |
| octolytics-dimension-repository_id | 1383170 |
| octolytics-dimension-repository_nwo | nodegit/nodegit |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1383170 |
| octolytics-dimension-repository_network_root_nwo | nodegit/nodegit |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1a427601e09953033b696253e754ebc7328096a7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width