performance.qbk 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. [section Performance]
  2. [#BOOST_METAPARSE_STRING_benchmark]
  3. [section Benchmarks of BOOST_METAPARSE_STRING]
  4. Measurements related to the performance of the
  5. [link BOOST_METAPARSE_STRING `BOOST_METAPARSE_STRING`] macro.
  6. [section Increasing string length]
  7. [include length128_gcc_4.8.5.qbk]
  8. [endsect]
  9. [section Increasing number of strings]
  10. [include number_gcc_4.8.5.qbk]
  11. [endsect]
  12. [section Increasing string length limit]
  13. [include max_length_gcc_4.8.5.qbk]
  14. [endsect]
  15. [endsect]
  16. [section Measuring printf]
  17. Parsers work at compile-time, thus their performance affects compilation speed.
  18. This section shows measurements of compilation time using Metaparse. The
  19. measurements were done on a Linux laptop with an 1.6 GHz Atom processor and 1 GB
  20. memory. The measurements were done using GCC 4.6.1 with `-std=c++0x` and no
  21. optimisation. Compilation speed was measured using the `time` utility.
  22. To measure a non-trivial parser, the `printf` example program were used for
  23. measurements. Here is a list of the `printf` calls and their compilation speed
  24. (`user` output of `time`):
  25. [table Printf compilation speed
  26. [[type-safe `printf` call] [Compilation speed (s)]]
  27. [[No compile-time parsing (just the includes and an empty `main`)] [3.51]]
  28. [[`printf<BOOST_METAPARSE_STRING("%f")>(1.0)`] [4.95]]
  29. [[`printf<BOOST_METAPARSE_STRING("%f%f")>(1.0, 2.0)`] [5.26]]
  30. [[`printf<BOOST_METAPARSE_STRING("%f%f%f")>(1.0, 2.0, 3.0)`] [5.50]]
  31. [[`printf<BOOST_METAPARSE_STRING("%f%f%f%f")>(1.0, 2.0, 3.0, 4.0)`] [5.82]]
  32. [[`printf<BOOST_METAPARSE_STRING("%f%f%f%f%f")>(1.0, 2.0, 3.0, 4.0, 5.0)`] [6.07]]
  33. ]
  34. [endsect]
  35. [section Further measurements]
  36. Further measurements can be found in the following paper:
  37. Zoltán Porkoláb, Ábel Sinkovics: [br]
  38. [*Domain-specific Language Integration with Compile-time Parser Generator Library] [br]
  39. In Eelco Visser, Jaakko Järvi, editors, Proceedings of the ninth
  40. international conference on Generative programming and component
  41. engineering (GPCE 2010). ACM, October 2010, pp. 137-146.
  42. [endsect]
  43. [endsect]