about summary refs log tree commit diff
path: root/src/rt/rust_run_program.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-03-22 10:18:53 -0700
committerbors <bors@rust-lang.org>2013-03-22 10:18:53 -0700
commitf011f928dd69a5b770b348aea2c547431c34e11a (patch)
treeb389e0437a91eb9917c5fe7166ebb9c46692f62a /src/rt/rust_run_program.cpp
parent1616ffd0c2627502b1015b6388480ed7429ef042 (diff)
parente93654c96d0288e6f2f00075d95dd4958b4cb4dc (diff)
downloadrust-f011f928dd69a5b770b348aea2c547431c34e11a.tar.gz
rust-f011f928dd69a5b770b348aea2c547431c34e11a.zip
auto merge of #5463 : alexcrichton/rust/faster-fmt, r=graydon
This is a minor step towards #3571, although I'm sure there's still more work to be done. Previously, `fmt!` collected a bunch of strings in a vector and then called `str::concat`. This changes the behavior by maintaining only one buffer and appending directly into that buffer. This avoids doubly-allocating memory, and it has the added bonus of reducing some allocations in `core::unstable::extfmt`

One of the unfortunate side effects of this is that the `rt` module in `extfmt.rs` had to be duplicated to avoid `stage0` errors. Dealing with the change in conversion functions may require a bit of a dance when a snapshot happens, but I think it's doable.

If the second speedup commit isn't deemed necessary, I got about a 15% speedup with just the first patch which doesn't require any modification of `extfmt.rs`, so no snapshot weirdness.

Here's some other things I ran into when looking at `fmt!`:
* I don't think that #2249 is relevant any more except for maybe removing one of `%i` or `%d`
* I'm not sure what was in mind for using traits with #3571, but I thought that formatters like `%u` could invoke the `to_uint()` method on the `NumCast` trait, but I ran into some problems like those in #5462

I'm having trouble thinking of other wins for `fmt!`, but if there's some suggestions I'd be more than willing to look into if they'd work out or not.
Diffstat (limited to 'src/rt/rust_run_program.cpp')
0 files changed, 0 insertions, 0 deletions