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