Title: git_revwalk_next is slow on first iteration since v0.25 · Issue #4428 · libgit2/libgit2 · GitHub
Open Graph Title: git_revwalk_next is slow on first iteration since v0.25 · Issue #4428 · libgit2/libgit2
X Title: git_revwalk_next is slow on first iteration since v0.25 · Issue #4428 · libgit2/libgit2
Description: git_revwalk_next is slow on its first iteration for versions 0.25, 0.26 and master when compared to v0.24. This is especially noticeable on large repositories. Reproduction steps Run the following program on the Linux kernel source tree ...
Open Graph Description: git_revwalk_next is slow on its first iteration for versions 0.25, 0.26 and master when compared to v0.24. This is especially noticeable on large repositories. Reproduction steps Run the following ...
X Description: git_revwalk_next is slow on its first iteration for versions 0.25, 0.26 and master when compared to v0.24. This is especially noticeable on large repositories. Reproduction steps Run the following ...
Opengraph URL: https://github.com/libgit2/libgit2/issues/4428
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"git_revwalk_next is slow on first iteration since v0.25","articleBody":"git_revwalk_next is slow on its first iteration for versions 0.25, 0.26 and master when compared to v0.24. This is especially noticeable on large repositories.\r\n\r\n### Reproduction steps\r\nRun the following program on the Linux kernel source tree (https://github.com/torvalds/linux):\r\n\r\n```c\r\n#include \u003cstdio.h\u003e\r\n#include \u003cgit2.h\u003e\r\n\r\nint main(int argc, char *argv[]) {\r\n git_libgit2_init();\r\n\r\n git_repository *repo;\r\n if (git_repository_open(\u0026repo, \".git\")) {\r\n fprintf(stderr, \"Failed to open repository\\n\");\r\n return 1;\r\n }\r\n\r\n git_oid oid;\r\n git_oid_fromstr(\u0026oid, \"a0651c7fa2c088a605f63792279859608ed7f2c8\");\r\n\r\n git_revwalk *revwalk;\r\n git_revwalk_new(\u0026revwalk, repo);\r\n git_revwalk_sorting(revwalk, GIT_SORT_TIME);\r\n git_revwalk_push(revwalk, \u0026oid);\r\n\r\n if (!git_revwalk_next(\u0026oid, revwalk)) {\r\n git_commit *commit;\r\n\r\n if (git_commit_lookup(\u0026commit, repo, \u0026oid)) {\r\n fprintf(stderr, \"Failed to lookup commit\\n\");\r\n return 1;\r\n }\r\n\r\n printf(\"%s\\n\", git_commit_message(commit));\r\n git_commit_free(commit);\r\n }\r\n\r\n git_revwalk_free(revwalk);\r\n git_repository_free(repo);\r\n\r\n return 0;\r\n}\r\n```\r\n\r\n### Expected behavior\r\nWhen using v0.24 this program runs in a couple of milliseconds:\r\n```\r\nrichard@DevNew:~/code/linux$ time ./revwalktest \u003e/dev/null\r\n\r\nreal\t0m0.006s\r\nuser\t0m0.000s\r\nsys\t0m0.006s\r\n```\r\n\r\n### Actual behavior\r\nWhen using v0.25, v0.26 or master this program has not completed after 1 minute:\r\n```\r\nrichard@DevNew:~/code/linux$ timeout 60s ./revwalktest\r\nrichard@DevNew:~/code/linux$ echo $?\r\n124\r\n```\r\n\r\n### Version of libgit2 (release number or SHA1)\r\nv0.25, v0.26 \u0026 master\r\n\r\n### Operating system(s) tested\r\n```\r\nLinux DevNew 4.13.0-17-generic #20-Ubuntu SMP Mon Nov 6 10:04:08 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux\r\n```","author":{"url":"https://github.com/rgburke","@type":"Person","name":"rgburke"},"datePublished":"2017-12-01T21:24:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":30},"url":"https://github.com/4428/libgit2/issues/4428"}
| 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:c7681c1e-b3e3-b237-fc70-5c2ff2137020 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DEE2:1B5602:4CE3EA3:65086B2:6A5D8BB8 |
| html-safe-nonce | beadaf97ca5b1021bb7ad8ea558158a36a07a3a712dd0f6a14ff808ac95151ac |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERUUyOjFCNTYwMjo0Q0UzRUEzOjY1MDg2QjI6NkE1RDhCQjgiLCJ2aXNpdG9yX2lkIjoiMjYwNTIxMzgxMDc2MTIzOTQ4MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5349c57bf1b2f3a474b549ad72f7f9142df5ed29a8e10efa887aab20e991ddcc |
| hovercard-subject-tag | issue:278600817 |
| 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/libgit2/libgit2/4428/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e937a9c6f739a50e48b2418923419ba4182f58fcbbf67f124afa82be85786668/libgit2/libgit2/issues/4428 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e937a9c6f739a50e48b2418923419ba4182f58fcbbf67f124afa82be85786668/libgit2/libgit2/issues/4428 |
| og:image:alt | git_revwalk_next is slow on its first iteration for versions 0.25, 0.26 and master when compared to v0.24. This is especially noticeable on large repositories. Reproduction steps Run the following ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rgburke |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/libgit2/libgit2 git https://github.com/libgit2/libgit2.git |
| octolytics-dimension-user_id | 394745 |
| octolytics-dimension-user_login | libgit2 |
| octolytics-dimension-repository_id | 901662 |
| octolytics-dimension-repository_nwo | libgit2/libgit2 |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 901662 |
| octolytics-dimension-repository_network_root_nwo | libgit2/libgit2 |
| 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 | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width