GitHub PullRequestReviewCommentEvent at 2014-11-18 10:31:16
Repository: neovim
Actor: jszakmeister
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/neovim/neovim/pulls/comments/20497028","id":20497028,"diff_hunk":"@@ -0,0 +1,18 @@\n+\n+#ifndef NVIM_DYNAMIC_BUFFER_H\n+#define NVIM_DYNAMIC_BUFFER_H\n+\n+#include \"nvim/types.h\"\n+\n+#define DYNAMIC_BUFFER_INIT {NULL, 0, 0}\n+\n+typedef struct {\n+  char *data;\n+  size_t cap, len;\n+} DynamicBuffer;","path":"src/nvim/dynamic_buffer.h","position":12,"original_position":12,"commit_id":"f610bd3c4b7af44aa32cd377e2942b61d9e47d14","original_commit_id":"f610bd3c4b7af44aa32cd377e2942b61d9e47d14","user":{"login":"jszakmeister","id":448087,"avatar_url":"https://avatars.githubusercontent.com/u/448087?v=3","gravatar_id":"","url":"https://api.github.com/users/jszakmeister","html_url":"https://github.com/jszakmeister","followers_url":"https://api.github.com/users/jszakmeister/followers","following_url":"https://api.github.com/users/jszakmeister/following{/other_user}","gists_url":"https://api.github.com/users/jszakmeister/gists{/gist_id}","starred_url":"https://api.github.com/users/jszakmeister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jszakmeister/subscriptions","organizations_url":"https://api.github.com/users/jszakmeister/orgs","repos_url":"https://api.github.com/users/jszakmeister/repos","events_url":"https://api.github.com/users/jszakmeister/events{/privacy}","received_events_url":"https://api.github.com/users/jszakmeister/received_events","type":"User","site_admin":false},"body":"Should we be providing some documentation on the members and their purpose?  Also, I'm not a huge fan of typedef'ing an anonymous structure--it can preclude things like forward declarations.  Would there be any heartache doing `typedef struct dynamic_buffer_t {` instead?","created_at":"2014-11-18T10:31:16Z","updated_at":"2014-11-18T10:31:16Z","html_url":"https://github.com/neovim/neovim/pull/1391#discussion_r20497028","pull_request_url":"https://api.github.com/repos/neovim/neovim/pulls/1391","_links":{"self":{"href":"https://api.github.com/repos/neovim/neovim/pulls/comments/20497028"},"html":{"href":"https://github.com/neovim/neovim/pull/1391#discussion_r20497028"},"pull_request":{"href":"https://api.github.com/repos/neovim/neovim/pulls/1391"}}},"pull_request":{"url":"https://api.github.com/repos/neovim/neovim/pulls/1391","id":23888543,"html_url":"https://github.com/neovim/neovim/pull/1391","diff_url":"https://github.com/neovim/neovim/pull/1391.diff","patch_url":"https://github.com/neovim/neovim/pull/1391.patch","issue_url":"https://api.github.com/repos/neovim/neovim/issues/1391","number":1391,"state":"open","locked":false,"title":"[RFC] diff: Send the text of the comparison through stdin.","user":{"login":"splinterofchaos","id":38515,"avatar_url":"https://avatars.githubusercontent.com/u/38515?v=3","gravatar_id":"","url":"https://api.github.com/users/splinterofchaos","html_url":"https://github.com/splinterofchaos","followers_url":"https://api.github.com/users/splinterofchaos/followers","following_url":"https://api.github.com/users/splinterofchaos/following{/other_user}","gists_url":"https://api.github.com/users/splinterofchaos/gists{/gist_id}","starred_url":"https://api.github.com/users/splinterofchaos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/splinterofchaos/subscriptions","organizations_url":"https://api.github.com/users/splinterofchaos/orgs","repos_url":"https://api.github.com/users/splinterofchaos/repos","events_url":"https://api.github.com/users/splinterofchaos/events{/privacy}","received_events_url":"https://api.github.com/users/splinterofchaos/received_events","type":"User","site_admin":false},"body":"Slight performance increase of `:diff[update|split]` in using `os_system()` to send the contents of the buffer. Here's my benchmark:\r\n```vim\r\nfunction! s:diff()\r\n  edit nvim/diff.c \r\n  vert diffsplit nvim/eval.c \" Test for two completely different files.\r\n  new | only\r\n  edit nvim/diff.c\r\n  vert diffsplit nvim/diff.master \" Two similar files.\r\nendfunction\r\n\r\ncommand! Do call s:diff()\r\n```\r\nAnd the results zooming in on the `diffsplit` lines:\r\n```\r\nbranch  total (s)   self (s)  type\r\nmastr   0.460142   0.210851    completely different\r\njob     0.431205   0.216067\r\nsys-out 0.429822   0.203984\r\nthis    0.408696   0.199957\r\n\r\nmastr   0.279197   0.114843   similar\r\njob     0.213775   0.062578\r\nsys-out 0.222114   0.073695\r\nthis    0.215443   0.068872\r\n```\r\n|name | branch | link |\r\n---------|---------|------\r\n|mastr | master | N/A|\r\n|this | this branch | N/A|\r\n|job     | Using a job instead of os_system | https://github.com/splinterofchaos/neovim/tree/diff-job-in|\r\n|sys-out | using os_system instead of redir | https://github.com/splinterofchaos/neovim/tree/diff-sys-out|\r\nso not the most exciting results in the world. Note: I found I got the biggest performance increase when I had CPU-intensive processes running in the background. I attempted various things such as running the `diff` program as a job, using a read callback, and using `os_system()` to get the output instead of using redirection, but I actually found these made it slower. (In case anyone's curious to test it, here's my branch for running `diff` in a job: https://github.com/splinterofchaos/neovim/tree/diff-job-in)","created_at":"2014-11-05T07:24:17Z","updated_at":"2014-11-18T10:31:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"20d4c74ba1145a3bf01345551212c63e666977fc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/neovim/neovim/pulls/1391/commits","review_comments_url":"https://api.github.com/repos/neovim/neovim/pulls/1391/comments","review_comment_url":"https://api.github.com/repos/neovim/neovim/pulls/comments/{number}","comments_url":"https://api.github.com/repos/neovim/neovim/issues/1391/comments","statuses_url":"https://api.github.com/repos/neovim/neovim/statuses/f610bd3c4b7af44aa32cd377e2942b61d9e47d14","head":{"label":"splinterofchaos:diff-sys","ref":"diff-sys","sha":"f610bd3c4b7af44aa32cd377e2942b61d9e47d14","user":{"login":"splinterofchaos","id":38515,"avatar_url":"https://avatars.githubusercontent.com/u/38515?v=3","gravatar_id":"","url":"https://api.github.com/users/splinterofchaos","html_url":"https://github.com/splinterofchaos","followers_url":"https://api.github.com/users/splinterofchaos/followers","following_url":"https://api.github.com/users/splinterofchaos/following{/other_user}","gists_url":"https://api.github.com/users/splinterofchaos/gists{/gist_id}","starred_url":"https://api.github.com/users/splinterofchaos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/splinterofchaos/subscriptions","organizations_url":"https://api.github.com/users/splinterofchaos/orgs","repos_url":"https://api.github.com/users/splinterofchaos/repos","events_url":"https://api.github.com/users/splinterofchaos/events{/privacy}","received_events_url":"https://api.github.com/users/splinterofchaos/received_events","type":"User","site_admin":false},"repo":{"id":21571013,"name":"neovim","full_name":"splinterofchaos/neovim","owner":{"login":"splinterofchaos","id":38515,"avatar_url":"https://avatars.githubusercontent.com/u/38515?v=3","gravatar_id":"","url":"https://api.github.com/users/splinterofchaos","html_url":"https://github.com/splinterofchaos","followers_url":"https://api.github.com/users/splinterofchaos/followers","following_url":"https://api.github.com/users/splinterofchaos/following{/other_user}","gists_url":"https://api.github.com/users/splinterofchaos/gists{/gist_id}","starred_url":"https://api.github.com/users/splinterofchaos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/splinterofchaos/subscriptions","organizations_url":"https://api.github.com/users/splinterofchaos/orgs","repos_url":"https://api.github.com/users/splinterofchaos/repos","events_url":"https://api.github.com/users/splinterofchaos/events{/privacy}","received_events_url":"https://api.github.com/users/splinterofchaos/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/splinterofchaos/neovim","description":"vim for the 21st century","fork":true,"url":"https://api.github.com/repos/splinterofchaos/neovim","forks_url":"https://api.github.com/repos/splinterofchaos/neovim/forks","keys_url":"https://api.github.com/repos/splinterofchaos/neovim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/splinterofchaos/neovim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/splinterofchaos/neovim/teams","hooks_url":"https://api.github.com/repos/splinterofchaos/neovim/hooks","issue_events_url":"https://api.github.com/repos/splinterofchaos/neovim/issues/events{/number}","events_url":"https://api.github.com/repos/splinterofchaos/neovim/events","assignees_url":"https://api.github.com/repos/splinterofchaos/neovim/assignees{/user}","branches_url":"https://api.github.com/repos/splinterofchaos/neovim/branches{/branch}","tags_url":"https://api.github.com/repos/splinterofchaos/neovim/tags","blobs_url":"https://api.github.com/repos/splinterofchaos/neovim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/splinterofchaos/neovim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/splinterofchaos/neovim/git/refs{/sha}","trees_url":"https://api.github.com/repos/splinterofchaos/neovim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/splinterofchaos/neovim/statuses/{sha}","languages_url":"https://api.github.com/repos/splinterofchaos/neovim/languages","stargazers_url":"https://api.github.com/repos/splinterofchaos/neovim/stargazers","contributors_url":"https://api.github.com/repos/splinterofchaos/neovim/contributors","subscribers_url":"https://api.github.com/repos/splinterofchaos/neovim/subscribers","subscription_url":"https://api.github.com/repos/splinterofchaos/neovim/subscription","commits_url":"https://api.github.com/repos/splinterofchaos/neovim/commits{/sha}","git_commits_url":"https://api.github.com/repos/splinterofchaos/neovim/git/commits{/sha}","comments_url":"https://api.github.com/repos/splinterofchaos/neovim/comments{/number}","issue_comment_url":"https://api.github.com/repos/splinterofchaos/neovim/issues/comments/{number}","contents_url":"https://api.github.com/repos/splinterofchaos/neovim/contents/{+path}","compare_url":"https://api.github.com/repos/splinterofchaos/neovim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/splinterofchaos/neovim/merges","archive_url":"https://api.github.com/repos/splinterofchaos/neovim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/splinterofchaos/neovim/downloads","issues_url":"https://api.github.com/repos/splinterofchaos/neovim/issues{/number}","pulls_url":"https://api.github.com/repos/splinterofchaos/neovim/pulls{/number}","milestones_url":"https://api.github.com/repos/splinterofchaos/neovim/milestones{/number}","notifications_url":"https://api.github.com/repos/splinterofchaos/neovim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/splinterofchaos/neovim/labels{/name}","releases_url":"https://api.github.com/repos/splinterofchaos/neovim/releases{/id}","created_at":"2014-07-07T13:13:12Z","updated_at":"2014-08-04T14:03:26Z","pushed_at":"2014-11-15T23:44:45Z","git_url":"git://github.com/splinterofchaos/neovim.git","ssh_url":"git@github.com:splinterofchaos/neovim.git","clone_url":"https://github.com/splinterofchaos/neovim.git","svn_url":"https://github.com/splinterofchaos/neovim","homepage":"http://neovim.org/","size":25905,"stargazers_count":0,"watchers_count":0,"language":"VimL","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"neovim:master","ref":"master","sha":"c347d9226a00d1ff8015fcdab1fb414e2c3e4c0a","user":{"login":"neovim","id":6471485,"avatar_url":"https://avatars.githubusercontent.com/u/6471485?v=3","gravatar_id":"","url":"https://api.github.com/users/neovim","html_url":"https://github.com/neovim","followers_url":"https://api.github.com/users/neovim/followers","following_url":"https://api.github.com/users/neovim/following{/other_user}","gists_url":"https://api.github.com/users/neovim/gists{/gist_id}","starred_url":"https://api.github.com/users/neovim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neovim/subscriptions","organizations_url":"https://api.github.com/users/neovim/orgs","repos_url":"https://api.github.com/users/neovim/repos","events_url":"https://api.github.com/users/neovim/events{/privacy}","received_events_url":"https://api.github.com/users/neovim/received_events","type":"Organization","site_admin":false},"repo":{"id":16408992,"name":"neovim","full_name":"neovim/neovim","owner":{"login":"neovim","id":6471485,"avatar_url":"https://avatars.githubusercontent.com/u/6471485?v=3","gravatar_id":"","url":"https://api.github.com/users/neovim","html_url":"https://github.com/neovim","followers_url":"https://api.github.com/users/neovim/followers","following_url":"https://api.github.com/users/neovim/following{/other_user}","gists_url":"https://api.github.com/users/neovim/gists{/gist_id}","starred_url":"https://api.github.com/users/neovim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neovim/subscriptions","organizations_url":"https://api.github.com/users/neovim/orgs","repos_url":"https://api.github.com/users/neovim/repos","events_url":"https://api.github.com/users/neovim/events{/privacy}","received_events_url":"https://api.github.com/users/neovim/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neovim/neovim","description":"vim out of the box","fork":false,"url":"https://api.github.com/repos/neovim/neovim","forks_url":"https://api.github.com/repos/neovim/neovim/forks","keys_url":"https://api.github.com/repos/neovim/neovim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neovim/neovim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neovim/neovim/teams","hooks_url":"https://api.github.com/repos/neovim/neovim/hooks","issue_events_url":"https://api.github.com/repos/neovim/neovim/issues/events{/number}","events_url":"https://api.github.com/repos/neovim/neovim/events","assignees_url":"https://api.github.com/repos/neovim/neovim/assignees{/user}","branches_url":"https://api.github.com/repos/neovim/neovim/branches{/branch}","tags_url":"https://api.github.com/repos/neovim/neovim/tags","blobs_url":"https://api.github.com/repos/neovim/neovim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neovim/neovim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neovim/neovim/git/refs{/sha}","trees_url":"https://api.github.com/repos/neovim/neovim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neovim/neovim/statuses/{sha}","languages_url":"https://api.github.com/repos/neovim/neovim/languages","stargazers_url":"https://api.github.com/repos/neovim/neovim/stargazers","contributors_url":"https://api.github.com/repos/neovim/neovim/contributors","subscribers_url":"https://api.github.com/repos/neovim/neovim/subscribers","subscription_url":"https://api.github.com/repos/neovim/neovim/subscription","commits_url":"https://api.github.com/repos/neovim/neovim/commits{/sha}","git_commits_url":"https://api.github.com/repos/neovim/neovim/git/commits{/sha}","comments_url":"https://api.github.com/repos/neovim/neovim/comments{/number}","issue_comment_url":"https://api.github.com/repos/neovim/neovim/issues/comments/{number}","contents_url":"https://api.github.com/repos/neovim/neovim/contents/{+path}","compare_url":"https://api.github.com/repos/neovim/neovim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neovim/neovim/merges","archive_url":"https://api.github.com/repos/neovim/neovim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neovim/neovim/downloads","issues_url":"https://api.github.com/repos/neovim/neovim/issues{/number}","pulls_url":"https://api.github.com/repos/neovim/neovim/pulls{/number}","milestones_url":"https://api.github.com/repos/neovim/neovim/milestones{/number}","notifications_url":"https://api.github.com/repos/neovim/neovim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neovim/neovim/labels{/name}","releases_url":"https://api.github.com/repos/neovim/neovim/releases{/id}","created_at":"2014-01-31T13:39:22Z","updated_at":"2014-11-18T10:15:02Z","pushed_at":"2014-11-18T09:19:44Z","git_url":"git://github.com/neovim/neovim.git","ssh_url":"git@github.com:neovim/neovim.git","clone_url":"https://github.com/neovim/neovim.git","svn_url":"https://github.com/neovim/neovim","homepage":"http://neovim.org/","size":64628,"stargazers_count":10614,"watchers_count":10614,"language":"VimL","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":688,"mirror_url":null,"open_issues_count":263,"forks":688,"open_issues":263,"watchers":10614,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/neovim/neovim/pulls/1391"},"html":{"href":"https://github.com/neovim/neovim/pull/1391"},"issue":{"href":"https://api.github.com/repos/neovim/neovim/issues/1391"},"comments":{"href":"https://api.github.com/repos/neovim/neovim/issues/1391/comments"},"review_comments":{"href":"https://api.github.com/repos/neovim/neovim/pulls/1391/comments"},"review_comment":{"href":"https://api.github.com/repos/neovim/neovim/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/neovim/neovim/pulls/1391/commits"},"statuses":{"href":"https://api.github.com/repos/neovim/neovim/statuses/f610bd3c4b7af44aa32cd377e2942b61d9e47d14"}}}}