CARVIEW |
Select Language
HTTP/2 200
x-amz-id-2: urkHD5F1YiY4Bpd4YbgEzP/ZQ04bU6zpwzj6sZCx4/MI+b9QBALfwPgjOivlRyJrIPA+U291W+E=
x-amz-request-id: 1Y07SZNPG0PG0XT0
last-modified: Mon, 05 May 2025 09:51:17 GMT
etag: "d2cf6a8a96b64697614522f990d1739a"
x-amz-server-side-encryption: AES256
server: AmazonS3
content-encoding: gzip
via: 1.1 varnish, 1.1 varnish
content-type: text/plain; charset=utf-8
accept-ranges: bytes
age: 0
date: Fri, 25 Jul 2025 20:03:48 GMT
x-served-by: cache-tyo11967-TYO, cache-bom-vanm7210026-BOM
x-cache: MISS, MISS
x-cache-hits: 0, 0
x-timer: S1753473828.690149,VS0,VE364
vary: Accept-Encoding
content-length: 775
From: "watson1978 (Shizuo Fujita) via ruby-core"
Date: 2025-05-05T09:40:44+00:00
Subject: [ruby-core:121829] [Ruby Feature#21308] Replacing the Float#to_s (dtoa.c) implementation with a modern algorithm
Issue #21308 has been reported by watson1978 (Shizuo Fujita).
----------------------------------------
Feature #21308: Replacing the Float#to_s (dtoa.c) implementation with a modern algorithm
https://bugs.ruby-lang.org/issues/21308
* Author: watson1978 (Shizuo Fujita)
* Status: Open
----------------------------------------
This is a feature request to replace Ruby's `Float#to_s` implementation with a modern high-performance float-to-string conversion algorithm such as Grisu.
Currently, `Float#to_s` in Ruby uses the BSD-derived implementation in [missing/dtoa.c](https://github.com/ruby/ruby/blob/master/missing/dtoa.c).
Meanwhile, `json` gem has adopted a Grisu-based implementation in [ruby/json#768](https://github.com/ruby/json/pull/768), it has been improve the performance of float-to-string conversion dramatically.
It appears to have brought about a 10 times improvement in performance.
However, the improvement is limited to the `json` gem.
If we can use the same implementation in `Float#to_s`, it will introduce the improvement in all float-to-string conversion cases.
(In additional, it would be better if an API could be added that could be called directly from the C extension library, it will reduce the overhead of the call.)
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/