mapnik/mapnik — pull request #1697 by springmeyer (2013-01-19 18:36:18+00:00)
Title: default to fast, simple, and correct (per ostringstream) to_string conversions

I propose simply using `snprintf` for converting built in types to strings. The reasons are:

1) This enables us to avoid the mixed usage of lexical_cast and karma, both can be dropped from use in conversions.cpp

2) `snprintf` output can easily be made to match exactly the output of `ostringstream`, which I think is desirable (this patch does this and updates the expected values in the tests). The original reason we switched from `ostringstream` to karma was due to performance in a threaded context (not needing locale based output). But the unintended consequence is odd formatting results (compared to `ostringstream`) using karma and the overhead of trying to fix this.

3) the `snprintf` approach is overall faster than karma as well, especially on os x, though karma on ubuntu might be slightly faster in a threaded context.