compile.erb.json 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <%
  2. def self.avg(xs)
  3. xs.inject(0, :+) / xs.length
  4. end
  5. def self.amortize(file)
  6. # We remove the first one to mitigate cache effects
  7. times = time_compilation(file, 6.times)
  8. times.shift
  9. avg(times.map { |_, t| t })
  10. end
  11. %>
  12. {
  13. "chart": {
  14. "type": "column"
  15. },
  16. "legend": {
  17. "enabled": false
  18. },
  19. "xAxis": {
  20. "type": "category"
  21. },
  22. "title": {
  23. "text": "Including various metaprogramming libraries"
  24. },
  25. "plotOptions": {
  26. "series": {
  27. "borderWidth": 0,
  28. "dataLabels": {
  29. "enabled": true,
  30. "format": "{point.y:.5f}s"
  31. }
  32. }
  33. },
  34. "series": [{
  35. "name": "Include time",
  36. "colorByPoint": true,
  37. "data": [
  38. {
  39. "name": "Baseline (no includes)",
  40. "y": <%= amortize('baseline.erb.cpp') %>
  41. }, {
  42. "name": "Boost.Hana",
  43. "y": <%= amortize('hana.erb.cpp') %>
  44. }
  45. <% if cmake_bool("@Boost_FOUND@") %>
  46. , {
  47. "name": "Boost.MPL",
  48. "y": <%= amortize('mpl.erb.cpp') %>
  49. }, {
  50. "name": "Boost.Fusion",
  51. "y": <%= amortize('fusion.erb.cpp') %>
  52. }
  53. <% end %>
  54. <% if cmake_bool("@MPL11_FOUND@") %>
  55. , {
  56. "name": "MPL11",
  57. "y": <%= amortize('mpl11.erb.cpp') %>
  58. }
  59. <% end %>
  60. <% if cmake_bool("@Meta_FOUND@") %>
  61. , {
  62. "name": "Meta",
  63. "y": <%= amortize('meta.erb.cpp') %>
  64. }
  65. <% end %>
  66. ]
  67. }]
  68. }