{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/26310","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/26310/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/26310/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/26310/events","html_url":"https://github.com/rust-lang/rust/issues/26310","id":88444170,"number":26310,"title":"Optimize Int to String (Display) methods.","user":{"login":"arthurprs","id":715958,"avatar_url":"https://avatars.githubusercontent.com/u/715958?v=3","gravatar_id":"","url":"https://api.github.com/users/arthurprs","html_url":"https://github.com/arthurprs","followers_url":"https://api.github.com/users/arthurprs/followers","following_url":"https://api.github.com/users/arthurprs/following{/other_user}","gists_url":"https://api.github.com/users/arthurprs/gists{/gist_id}","starred_url":"https://api.github.com/users/arthurprs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthurprs/subscriptions","organizations_url":"https://api.github.com/users/arthurprs/orgs","repos_url":"https://api.github.com/users/arthurprs/repos","events_url":"https://api.github.com/users/arthurprs/events{/privacy}","received_events_url":"https://api.github.com/users/arthurprs/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-15T14:32:39Z","updated_at":"2015-06-15T14:40:28Z","closed_at":"2015-06-15T14:40:28Z","body":"As of today rust uses a naive implementation for converting integers to decimal strings in ***Int*** [Debug/Display methods](https://github.com/rust-lang/rust/blob/f76d9bcfc2c269452522fbbe19f66fe653325646/src/libcore/fmt/num.rs).\r\n\r\nI propose adding an optimization for the most commonly used case, that is, printing as decimals.\r\n\r\nI wrote a reasonably optimized version [here](https://github.com/arthurprs/rust-optimized-inttostr). Further optimizations are possible but I tried to keep the code size small (which I think is important),  it's a road of diminished gains.\r\n\r\nThis should be non measurable overall but might give us a minor speedup on ***serde*** and ***rustc*** serializers.\r\n\r\nShould I adapt the code and file PR?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/112093099","html_url":"https://github.com/rust-lang/rust/issues/26310#issuecomment-112093099","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/26310","id":112093099,"user":{"login":"steveklabnik","id":27786,"avatar_url":"https://avatars.githubusercontent.com/u/27786?v=3","gravatar_id":"","url":"https://api.github.com/users/steveklabnik","html_url":"https://github.com/steveklabnik","followers_url":"https://api.github.com/users/steveklabnik/followers","following_url":"https://api.github.com/users/steveklabnik/following{/other_user}","gists_url":"https://api.github.com/users/steveklabnik/gists{/gist_id}","starred_url":"https://api.github.com/users/steveklabnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveklabnik/subscriptions","organizations_url":"https://api.github.com/users/steveklabnik/orgs","repos_url":"https://api.github.com/users/steveklabnik/repos","events_url":"https://api.github.com/users/steveklabnik/events{/privacy}","received_events_url":"https://api.github.com/users/steveklabnik/received_events","type":"User","site_admin":false},"created_at":"2015-06-15T14:40:28Z","updated_at":"2015-06-15T14:40:28Z","body":"> Should I adapt the code and file PR?\r\n\r\nI'd want something more than 'might give us a minor speedup', if you can post benchmarks that show it's faster, then we'd probably take such a thing, but benchmarks are important :)\r\n\r\n(also, https://internals.rust-lang.org/ might be a better forum for this kind of question, as it isn't really a bug, exactly. So closing!)"}}