{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/27256","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/27256/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/27256/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/27256/events","html_url":"https://github.com/rust-lang/rust/pull/27256","id":97034180,"number":27256,"title":"Speed up fannkuch-redux with unsafe code","user":{"login":"llogiq","id":4200835,"avatar_url":"https://avatars.githubusercontent.com/u/4200835?v=3","gravatar_id":"","url":"https://api.github.com/users/llogiq","html_url":"https://github.com/llogiq","followers_url":"https://api.github.com/users/llogiq/followers","following_url":"https://api.github.com/users/llogiq/following{/other_user}","gists_url":"https://api.github.com/users/llogiq/gists{/gist_id}","starred_url":"https://api.github.com/users/llogiq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llogiq/subscriptions","organizations_url":"https://api.github.com/users/llogiq/orgs","repos_url":"https://api.github.com/users/llogiq/repos","events_url":"https://api.github.com/users/llogiq/events{/privacy}","received_events_url":"https://api.github.com/users/llogiq/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"BurntSushi","id":456674,"avatar_url":"https://avatars.githubusercontent.com/u/456674?v=3","gravatar_id":"","url":"https://api.github.com/users/BurntSushi","html_url":"https://github.com/BurntSushi","followers_url":"https://api.github.com/users/BurntSushi/followers","following_url":"https://api.github.com/users/BurntSushi/following{/other_user}","gists_url":"https://api.github.com/users/BurntSushi/gists{/gist_id}","starred_url":"https://api.github.com/users/BurntSushi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BurntSushi/subscriptions","organizations_url":"https://api.github.com/users/BurntSushi/orgs","repos_url":"https://api.github.com/users/BurntSushi/repos","events_url":"https://api.github.com/users/BurntSushi/events{/privacy}","received_events_url":"https://api.github.com/users/BurntSushi/received_events","type":"User","site_admin":false},"milestone":null,"comments":13,"created_at":"2015-07-24T11:32:19Z","updated_at":"2015-07-24T14:32:22Z","closed_at":"2015-07-24T14:32:22Z","pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/27256","html_url":"https://github.com/rust-lang/rust/pull/27256","diff_url":"https://github.com/rust-lang/rust/pull/27256.diff","patch_url":"https://github.com/rust-lang/rust/pull/27256.patch"},"body":"Knowing that the current version of fannkuch-redux uses a loop to rotate the slice (heh, good pun), I created a small microbenchmark using std::intrinsics::copy instead, rotating a 16-int-array. Results on my machine:\r\n\r\n```\r\ntest bench_rotate_16     ... bench:         797 ns/iter (+/- 4)\r\ntest bench_rotate_16_new ... bench:          65 ns/iter (+/- 1)\r\n```\r\n\r\nTested on nightly, but I think it *should* work with beta, too. Seeing that reverse-complement already uses unsafe, we also may want to pursue it here.\r\n\r\nr? @BurntSushi "},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/124542302","html_url":"https://github.com/rust-lang/rust/pull/27256#issuecomment-124542302","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/27256","id":124542302,"user":{"login":"llogiq","id":4200835,"avatar_url":"https://avatars.githubusercontent.com/u/4200835?v=3","gravatar_id":"","url":"https://api.github.com/users/llogiq","html_url":"https://github.com/llogiq","followers_url":"https://api.github.com/users/llogiq/followers","following_url":"https://api.github.com/users/llogiq/following{/other_user}","gists_url":"https://api.github.com/users/llogiq/gists{/gist_id}","starred_url":"https://api.github.com/users/llogiq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llogiq/subscriptions","organizations_url":"https://api.github.com/users/llogiq/orgs","repos_url":"https://api.github.com/users/llogiq/repos","events_url":"https://api.github.com/users/llogiq/events{/privacy}","received_events_url":"https://api.github.com/users/llogiq/received_events","type":"User","site_admin":false},"created_at":"2015-07-24T14:32:21Z","updated_at":"2015-07-24T14:32:21Z","body":"@killercup I certainly do :smile::\r\n\r\n```\r\nrunning 4 tests\r\ntest test_rotate_1 ... ignored\r\ntest test_rotate_16 ... ignored\r\ntest bench_rotate_16     ... bench:           6 ns/iter (+/- 1)\r\ntest bench_rotate_16_new ... bench:          11 ns/iter (+/- 0)\r\n```\r\n\r\nSo it appears the original version is actually faster."}}