[metrics-bugs] #28799 [Metrics/Website]: Use R.cache to speed up drawing graphs

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Dec 17 21:08:57 UTC 2018


#28799: Use R.cache to speed up drawing graphs
-----------------------------+------------------------------
 Reporter:  karsten          |          Owner:  karsten
     Type:  enhancement      |         Status:  needs_review
 Priority:  Medium           |      Milestone:
Component:  Metrics/Website  |        Version:
 Severity:  Normal           |     Resolution:
 Keywords:                   |  Actual Points:
Parent ID:                   |         Points:
 Reviewer:                   |        Sponsor:
-----------------------------+------------------------------
Changes (by karsten):

 * status:  needs_information => needs_review


Comment:

 Alright, turns out that readr works even better than R.cache! Some stats:

 ||                            ||= load()=||= R.cache n=1=||= R.cache
 n>1=||= read_csv()=||
 || userstats-relay-country    ||    1.148||         4.564||
 1.879||        1.198||
 || userstats-bridge-country   ||    0.842||         1.746||
 1.711||        0.990||
 || userstats-bridge-transport ||    0.761||         1.805||
 1.714||        0.769||
 || userstats-bridge-version   ||    0.774||         1.696||
 1.707||        0.842||
 || userstats-bridge-combined  ||    8.937||        12.346||
 9.448||        1.222||
 || webstats-tb                ||    0.355||         3.132||
 0.371||        0.691||
 || webstats-tb-platform       ||    2.916||         0.341||
 0.392||        0.635||
 || webstats-tb-locale         ||    3.035||         0.484||
 0.456||        0.779||
 || webstats-tm                ||    0.185||         0.248||
 0.219||        0.435||

 We're currently using `load()` to load the .RData files back to memory
 that we prepared as part of the daily update. My previous suggestion was
 to use R.cache, with performance varying depending on whether we have read
 a CSV file before. The latest suggestion is to use `read_csv()` from the
 readr package.

 I'd say readr is the clear winner, despite minimal performance decreases
 for some of the user graphs.

 Please review [https://gitweb.torproject.org/user/karsten/metrics-
 web.git/commit/?h=task-28799-2&id=323bfbf1c078a94524f66519a4ae6d0005119f7a
 commit 323bfbf in my task-28799-2 branch].

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/28799#comment:6>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the metrics-bugs mailing list