Closed Bug 571723 Opened 14 years ago Closed 14 years ago

TM: add grisu3 double to string conversion algorithm implementation

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 558799

People

(Reporter: gal, Assigned: gal)

Details

Attachments

(1 file)

V8 was so kind to implement this. See also Loitsch et al., "Printing Floating-Point Numbers Quickly and Accurately with Integers", PLDI'10.
Attached patch patchSplinter Review
This patch adds the grisu3 implementation from V8. Its not wired up yet, but it compiles.
Assignee: general → gal
Cool -- does this free us of the *dtoa.c code whose old ugly '80s C style makes angels cry tears of blood?

/be
No. grisu3 prints the correct number in 99.8% of cases, and refuses to print in the others, in which case we have to fall back on dtoa. grisu is a 4x speedup, so its very likely worth it.
99.8% fewer tears of blood -- Ok. Maybe some day the 0.2% will be gone.

/be
Sunspider dtoa statistics:

   2 4.096774
   2 9.645161
   2 9.661290
   2 9.903226
   2 9.919355
  60 0.070000
 920 0.800000

4088 dtoa calls in total.
v8-splay:

  294405 dtoa calls

Utterly f* ridiculous. No dtoa conversion in the rest of the v8 suite.
This would be totally helpful for things that do left/top CSS style animations too.
(In reply to comment #6)
> v8-splay:
> 
>   294405 dtoa calls
> 
> Utterly f* ridiculous.

And just think, bug 562553 removed 97% of them.  Hence http://code.google.com/p/v8/issues/detail?id=690, which looks like it's being worked on.  Also note http://code.google.com/p/v8/issues/detail?id=690#c2 which explains that the Setup and Teardown functions aren't measured in the official V8 suite, but that Sunspider does measure them(!)
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: