{"action":"created","issue":{"url":"https://api.github.com/repos/rnabioco/valr/issues/259","repository_url":"https://api.github.com/repos/rnabioco/valr","labels_url":"https://api.github.com/repos/rnabioco/valr/issues/259/labels{/name}","comments_url":"https://api.github.com/repos/rnabioco/valr/issues/259/comments","events_url":"https://api.github.com/repos/rnabioco/valr/issues/259/events","html_url":"https://github.com/rnabioco/valr/issues/259","id":230792046,"number":259,"title":"Recent benchmarks","user":{"login":"jayhesselberth","id":355367,"avatar_url":"https://avatars0.githubusercontent.com/u/355367?v=3","gravatar_id":"","url":"https://api.github.com/users/jayhesselberth","html_url":"https://github.com/jayhesselberth","followers_url":"https://api.github.com/users/jayhesselberth/followers","following_url":"https://api.github.com/users/jayhesselberth/following{/other_user}","gists_url":"https://api.github.com/users/jayhesselberth/gists{/gist_id}","starred_url":"https://api.github.com/users/jayhesselberth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayhesselberth/subscriptions","organizations_url":"https://api.github.com/users/jayhesselberth/orgs","repos_url":"https://api.github.com/users/jayhesselberth/repos","events_url":"https://api.github.com/users/jayhesselberth/events{/privacy}","received_events_url":"https://api.github.com/users/jayhesselberth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-23T17:50:57Z","updated_at":"2017-05-25T17:44:43Z","closed_at":null,"body":"``` r\r\nlibrary(valr)\r\nlibrary(dplyr)\r\n#> \r\n#> Attaching package: 'dplyr'\r\n#> The following objects are masked from 'package:stats':\r\n#> \r\n#>     filter, lag\r\n#> The following objects are masked from 'package:base':\r\n#> \r\n#>     intersect, setdiff, setequal, union\r\nlibrary(ggplot2)\r\nlibrary(tibble)\r\nlibrary(scales)\r\nlibrary(microbenchmark)\r\n\r\ngenome <- read_genome(valr_example('hg19.chrom.sizes.gz'))\r\n\r\n# number of intervals\r\nn <- 1e6\r\n# number of timing reps\r\nnrep <- 20\r\n\r\nseed_x <- 1010486\r\nx <- bed_random(genome, n = n, seed = seed_x)\r\nseed_y <- 9283019\r\ny <- bed_random(genome, n = n, seed = seed_y)\r\n\r\nres <- microbenchmark(\r\n  # randomizing functions\r\n  bed_random(genome, n = n, seed = seed_x),\r\n  bed_shuffle(x, genome, seed = seed_x),\r\n  # # single tbl functions\r\n  bed_slop(x, genome, both = 1000),\r\n  bed_flank(x, genome, both = 1000),\r\n  bed_merge(x),\r\n  bed_cluster(x),\r\n  bed_complement(x, genome),\r\n  # multi tbl functions\r\n  bed_closest(x, y),\r\n  bed_intersect(x, y),\r\n  bed_map(x, y, .n = n()),\r\n  bed_subtract(x, y),\r\n  # stats\r\n  bed_absdist(x, y, genome),\r\n  bed_reldist(x, y),\r\n  bed_jaccard(x, y),\r\n  bed_fisher(x, y, genome),\r\n  bed_projection(x, y, genome),\r\n  # utilities\r\n  # don't test makewindows ... too slooow\r\n  bound_intervals(x, genome),\r\n  # bed_makewindows(x, genome, win_size = 10),\r\n  times = nrep,\r\n  unit = 's')\r\n\r\n# covert nanoseconds to seconds\r\nres <- res %>%\r\n  as_tibble() %>%\r\n  mutate(time = time / 1e9) %>%\r\n  arrange(time)\r\n\r\n# futz with the x-axis\r\nsts <- boxplot.stats(res$time)$stats\r\n# filter out outliers\r\nres <- filter(res, time <= max(sts) * 1.05)\r\n\r\nggplot(res, aes(x=reorder(expr, time), y=time)) +\r\n  geom_boxplot(fill = 'red', outlier.shape = NA, alpha = 0.5) +\r\n  coord_flip() +\r\n  theme_bw() +\r\n  labs(\r\n    y='execution time (seconds)',\r\n    x='',\r\n    title=\"valr benchmarks\",\r\n    subtitle=paste(comma(n), \"random x/y intervals,\", comma(nrep), \"repititions\"))\r\n```\r\n\r\n![](http://i.imgur.com/PJg1Kg3.png)"},"comment":{"url":"https://api.github.com/repos/rnabioco/valr/issues/comments/304074911","html_url":"https://github.com/rnabioco/valr/issues/259#issuecomment-304074911","issue_url":"https://api.github.com/repos/rnabioco/valr/issues/259","id":304074911,"user":{"login":"jayhesselberth","id":355367,"avatar_url":"https://avatars0.githubusercontent.com/u/355367?v=3","gravatar_id":"","url":"https://api.github.com/users/jayhesselberth","html_url":"https://github.com/jayhesselberth","followers_url":"https://api.github.com/users/jayhesselberth/followers","following_url":"https://api.github.com/users/jayhesselberth/following{/other_user}","gists_url":"https://api.github.com/users/jayhesselberth/gists{/gist_id}","starred_url":"https://api.github.com/users/jayhesselberth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayhesselberth/subscriptions","organizations_url":"https://api.github.com/users/jayhesselberth/orgs","repos_url":"https://api.github.com/users/jayhesselberth/repos","events_url":"https://api.github.com/users/jayhesselberth/events{/privacy}","received_events_url":"https://api.github.com/users/jayhesselberth/received_events","type":"User","site_admin":false},"created_at":"2017-05-25T17:44:43Z","updated_at":"2017-05-25T17:44:43Z","body":"After recent updates to makewindows, flank, merge.\r\n\r\n``` r\r\nlibrary(valr)\r\nlibrary(dplyr)\r\n#> \r\n#> Attaching package: 'dplyr'\r\n#> The following objects are masked from 'package:stats':\r\n#> \r\n#>     filter, lag\r\n#> The following objects are masked from 'package:base':\r\n#> \r\n#>     intersect, setdiff, setequal, union\r\nlibrary(ggplot2)\r\nlibrary(tibble)\r\nlibrary(scales)\r\nlibrary(microbenchmark)\r\n\r\ngenome <- read_genome(valr_example('hg19.chrom.sizes.gz'))\r\n\r\n# number of intervals\r\nn <- 1e6\r\n# number of timing reps\r\nnrep <- 20\r\n\r\nseed_x <- 1010486\r\nx <- bed_random(genome, n = n, seed = seed_x)\r\nseed_y <- 9283019\r\ny <- bed_random(genome, n = n, seed = seed_y)\r\n\r\nres <- microbenchmark(\r\n  # randomizing functions\r\n  bed_random(genome, n = n, seed = seed_x),\r\n  bed_shuffle(x, genome, seed = seed_x),\r\n  # # single tbl functions\r\n  bed_slop(x, genome, both = 1000),\r\n  bed_flank(x, genome, both = 1000),\r\n  bed_merge(x),\r\n  bed_cluster(x),\r\n  bed_complement(x, genome),\r\n  # multi tbl functions\r\n  bed_closest(x, y),\r\n  bed_intersect(x, y),\r\n  bed_map(x, y, .n = n()),\r\n  bed_subtract(x, y),\r\n  # stats\r\n  bed_absdist(x, y, genome),\r\n  bed_reldist(x, y),\r\n  bed_jaccard(x, y),\r\n  bed_fisher(x, y, genome),\r\n  bed_projection(x, y, genome),\r\n  # utilities\r\n  bed_makewindows(x, genome, win_size = 100),\r\n  times = nrep,\r\n  unit = 's')\r\n\r\n# covert nanoseconds to seconds\r\nres <- res %>%\r\n  as_tibble() %>%\r\n  mutate(time = time / 1e9) %>%\r\n  arrange(time)\r\n\r\n# futz with the x-axis\r\nsts <- boxplot.stats(res$time)$stats\r\n# filter out outliers\r\nres <- filter(res, time <= max(sts) * 1.05)\r\n\r\nggplot(res, aes(x=reorder(expr, time), y=time)) +\r\n  geom_boxplot(fill = 'red', outlier.shape = NA, alpha = 0.5) +\r\n  coord_flip() +\r\n  theme_bw() +\r\n  labs(\r\n    y='execution time (seconds)',\r\n    x='',\r\n    title=\"valr benchmarks\",\r\n    subtitle=paste(comma(n), \"random x/y intervals,\", comma(nrep), \"repititions\"))\r\n```\r\n\r\n![](http://i.imgur.com/KfpP66w.png)"}}
{"actor":{"display_login":"jayhesselberth"}}