Closed 10110111 closed 6 years ago
Interesting, I'll have to take a close look at this.
In general, I am always in favor of optional dependencies. As in, things will work just the same if the user doesn't have the dep, but if they happen to have it installed, things will work better automagically.
Hi, any news on this?
Sorry, I didn't realize you were waiting for further input.
My understanding is that this PR was not intended to be merged but was simply an RFC, much about adding new dependencies.
In general and in this case I support adding new dependencies, I would just like to make sure that we have a graceful fall back for when the dependencies aren't there.
Of course, I am sure that there are cases where a new feature simply requires a dependency. I figure we'll tackle those on a case-by-case basis.
Yeah, the point 1. had been answered by your first comment. I'm now mainly interested in your opinion on points 2. and 3..
I think whatever you feel would result in the highest quality code/results is fine by me 👍
These patches implement formatting of floating-point values without the ugliness of numbers like
1e-11
looking like9.9999999999999994e-12
. The cost of this is introduction of two optional dependencies to EDB.double-conversion
library used by e.g. Chromium and Firefox, as well as some other projects. It provides fast routines to formatfloat
anddouble
numbers in their shortest round-tripping form (based on the Grisu3 algorithm and some bignum code as fallback).long double
is a second-class citizen in modern world, anddouble-conversion
doesn't support it. So the second dependency is thegdtoa
library by David M. Gay — in the form of a version adapted to the reality of common Linux distributions. This version can be seen at https://github.com/10110111/gdtoa (yes, the adaptation was done by me).Now, this PR is an RFC, not intended to be merged as is. The
gdtoa
repo is even in a form that might be not best to reference (e.g. it might be a good idea to give it a bit different name to avoid confusion with the originalgdtoa
(which it does contain though)). I've not updated the README, and have a few questions/issues to discuss.double-conversion
whengdtoa
seems to be enough may seem redundant. But the reason I did this nonetheless is thatdouble-conversion
is several times faster thangdtoa
, especially in the more common (for a debugger) case of very small and very large values (e.g.XMM0
register containing a vector of smalldword
s would look like containing denormals in float view). Since EDB may need to do quite many conversions on each single-step due to SIMD registers, performance doesn't look like a negligible concern.double-conversion
to nicely formatfloat
s anddouble
s, althoughgdtoa
is capable of this too. It might be a good idea to usegdtoa
for all the types ifdouble-conversion
is for some reason unavailable, whilegdtoa
is available.For reference, here're my performance measurements on Core i7-4765T: