為 DataCamp 的機器做效能基準測試
benchmarkme 套件可以執行一組標準化的基準測試,並將你的結果與其他使用者比較。其中一組測試是讀寫速度。
以下函式呼叫:
res = benchmark_io(runs = 1, size = 5)
會記錄讀取與寫出一個 5MB 檔案所需的時間長度。
本練習屬於課程
撰寫高效 R 程式碼
練習說明
- 找出讀取與寫出一個 5 MB 檔案所需的時間,並將結果指定給
res。(不要嘗試讀寫 50 MB 檔案,否則你在 DataCamp 的工作階段可能會當掉) - 透過
plot(res)將 DataCamp 與其他使用者比較。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Load the package
library("benchmarkme")
# Run the io benchmark
res <- ___(runs = 1, size = ___)
# Plot the results
___