about summary refs log tree commit diff
path: root/src/test/bench
AgeCommit message (Collapse)AuthorLines
2014-04-01rand: bubble up IO messages futher.Huon Wilson-1/+1
The various ...Rng::new() methods can hit IO errors from the OSRng they use, and it seems sensible to expose them at a higher level. Unfortunately, writing e.g. `StdRng::new().unwrap()` gives a much poorer error message than if it failed internally, but this is a problem with all `IoResult`s.
2014-03-31auto merge of #13221 : thestinger/rust/append, r=alexcrichtonbors-7/+5
These were only free functions on `~[T]` because taking self by-value used to be broken.
2014-03-30auto merge of #13206 : TeXitoi/rust/fix-shootout-k-nucleotide, r=alexcrichtonbors-35/+37
Correct printing (sort, new lines), reading on stdin.
2014-03-31vec: convert `append` and `append_one` to methodsDaniel Micay-7/+5
These were only free functions on `~[T]` because taking self by-value used to be broken.
2014-03-30make shootout-k-nucleotide.rs pass official testGuillaume Pinot-35/+37
Correct printing (sort, new lines), reading on stdin, s/i32/uint/, ignore-android because it reads stdin
2014-03-28collections: remove ListErick Tryzelaar-1/+5
It was decided in a meeting that this module wasn't needed, and more thought should be put into a persistent collections library.
2014-03-26bench: Put the spawn bench back on libgreenAlex Crichton-1/+13
This bench is meant to exercise libgreen, not libnative. It recently caused the auto-linux-32-nopt-t bot to fail as no output was produced for an hour.
2014-03-24test: Update all tests with the sync changesAlex Crichton-48/+39
2014-03-23iter: remove `to_owned_vec`Daniel Micay-1/+1
This needs to be removed as part of removing `~[T]`. Partial type hints are now allowed, and will remove the need to add a version of this method for `Vec<T>`. For now, this involves a few workarounds for partial type hints not completely working.
2014-03-22Remove outdated and unnecessary std::vec_ng::Vec imports.Huon Wilson-24/+9
(And fix some tests.)
2014-03-21test: Make manual changes to deal with the fallout from removal ofPatrick Walton-102/+142
`~[T]` in test, libgetopts, compiletest, librustdoc, and libnum.
2014-03-21test: Automatically remove all `~[T]` from tests.Patrick Walton-114/+115
2014-03-20rename std::vec -> std::sliceDaniel Micay-29/+29
Closes #12702
2014-03-15log: Introduce liblog, the old std::loggingAlex Crichton-25/+25
This commit moves all logging out of the standard library into an external crate. This crate is the new crate which is responsible for all logging macros and logging implementation. A few reasons for this change are: * The crate map has always been a bit of a code smell among rust programs. It has difficulty being loaded on almost all platforms, and it's used almost exclusively for logging and only logging. Removing the crate map is one of the end goals of this movement. * The compiler has a fair bit of special support for logging. It has the __log_level() expression as well as generating a global word per module specifying the log level. This is unfairly favoring the built-in logging system, and is much better done purely in libraries instead of the compiler itself. * Initialization of logging is much easier to do if there is no reliance on a magical crate map being available to set module log levels. * If the logging library can be written outside of the standard library, there's no reason that it shouldn't be. It's likely that we're not going to build the highest quality logging library of all time, so third-party libraries should be able to provide just as high-quality logging systems as the default one provided in the rust distribution. With a migration such as this, the change does not come for free. There are some subtle changes in the behavior of liblog vs the previous logging macros: * The core change of this migration is that there is no longer a physical log-level per module. This concept is still emulated (it is quite useful), but there is now only a global log level, not a local one. This global log level is a reflection of the maximum of all log levels specified. The previously generated logging code looked like: if specified_level <= __module_log_level() { println!(...) } The newly generated code looks like: if specified_level <= ::log::LOG_LEVEL { if ::log::module_enabled(module_path!()) { println!(...) } } Notably, the first layer of checking is still intended to be "super fast" in that it's just a load of a global word and a compare. The second layer of checking is executed to determine if the current module does indeed have logging turned on. This means that if any module has a debug log level turned on, all modules with debug log levels get a little bit slower (they all do more expensive dynamic checks to determine if they're turned on or not). Semantically, this migration brings no change in this respect, but runtime-wise, this will have a perf impact on some code. * A `RUST_LOG=::help` directive will no longer print out a list of all modules that can be logged. This is because the crate map will no longer specify the log levels of all modules, so the list of modules is not known. Additionally, warnings can no longer be provided if a malformed logging directive was supplied. The new "hello world" for logging looks like: #[phase(syntax, link)] extern crate log; fn main() { debug!("Hello, world!"); }
2014-03-14extra: Put the nail in the coffin, delete libextraAlex Crichton-15/+0
This commit shreds all remnants of libextra from the compiler and standard distribution. Two modules, c_vec/tempfile, were moved into libstd after some cleanup, and the other modules were moved to separate crates as seen fit. Closes #8784 Closes #12413 Closes #12576
2014-03-13auto merge of #12815 : alexcrichton/rust/chan-rename, r=brsonbors-76/+71
* Chan<T> => Sender<T> * Port<T> => Receiver<T> * Chan::new() => channel() * constructor returns (Sender, Receiver) instead of (Receiver, Sender) * local variables named `port` renamed to `rx` * local variables named `chan` renamed to `tx` Closes #11765
2014-03-13std: Rename Chan/Port types and constructorAlex Crichton-76/+71
* Chan<T> => Sender<T> * Port<T> => Receiver<T> * Chan::new() => channel() * constructor returns (Sender, Receiver) instead of (Receiver, Sender) * local variables named `port` renamed to `rx` * local variables named `chan` renamed to `tx` Closes #11765
2014-03-12Update io iterators to produce IoResultsPalmer Cox-2/+2
Most IO related functions return an IoResult so that the caller can handle failure in whatever way is appropriate. However, the `lines`, `bytes`, and `chars` iterators all supress errors. This means that code that needs to handle errors can't use any of these iterators. All three of these iterators were updated to produce IoResults. Fixes #12368
2014-03-12rand: deprecate `rng`.Huon Wilson-3/+3
This should be called far less than it is because it does expensive OS interactions and seeding of the internal RNG, `task_rng` amortises this cost. The main problem is the name is so short and suggestive. The direct equivalent is `StdRng::new`, which does precisely the same thing. The deprecation will make migrating away from the function easier.
2014-03-12Update users for the std::rand -> librand move.Huon Wilson-5/+8
2014-03-11auto merge of #12765 : TeXitoi/rust/fix-shootout-reverse-complement, ↵bors-1/+3
r=alexcrichton
2014-03-11fix a bug in shootout-reverse-complement, official tests should pass with itGuillaume Pinot-1/+3
In the "reverse-complement" loop, if there is an odd number of element, we forget to complement the element in the middle. For example, if the input is "ggg", the result before the fix is "CgC" instead of "CCC". This is because of this bug that the official shootout says that the rust version is in "Bad Output". This commit should fix this error.
2014-03-10auto merge of #12766 : TeXitoi/rust/fix-shootout-spectralnorm, r=alexcrichtonbors-11/+18
2014-03-09fix shootout-spectralnorm, broken since Arc cannot unwrap.Guillaume Pinot-11/+18
2014-03-07create a sensible comparison trait hierarchyDaniel Micay-1/+1
* `Ord` inherits from `Eq` * `TotalOrd` inherits from `TotalEq` * `TotalOrd` inherits from `Ord` * `TotalEq` inherits from `Eq` This is a partial implementation of #12517.
2014-03-06fix typos with with repeated words, just like this sentence.Kang Seonghoon-2/+2
2014-03-01std: Switch stdout/stderr to buffered by defaultAlex Crichton-5/+4
Similarly to #12422 which made stdin buffered by default, this commit makes the output streams also buffered by default. Now that buffered writers will flush their contents when they are dropped, I don't believe that there's no reason why the output shouldn't be buffered by default, which is what you want in 90% of cases. As with stdin, there are new stdout_raw() and stderr_raw() functions to get unbuffered streams to stdout/stderr.
2014-02-25test: Clean out the test suite a bitAlex Crichton-366/+207
This updates a number of ignore-test tests, and removes a few completely outdated tests due to the feature being tested no longer being supported. This brings a number of bench/shootout tests up to date so they're compiling again. I make no claims to the performance of these benchmarks, it's just nice to not have bitrotted code. Closes #2604 Closes #9407
2014-02-24Remove std::from_str::FromStr from the preludeBrendan Zabarauskas-0/+2
2014-02-23auto merge of #12311 : brson/rust/unstable, r=alexcrichtonbors-1/+1
With the stability attributes we can put public-but unstable modules next to others, so this moves `intrinsics` and `raw` out of the `unstable` module (and marks both as `#[experimental]`).
2014-02-23std: Move intrinsics to std::intrinsics.Brian Anderson-1/+1
Issue #1457
2014-02-23Move std::{trie, hashmap} to libcollectionsAlex Crichton-6/+5
These two containers are indeed collections, so their place is in libcollections, not in libstd. There will always be a hash map as part of the standard distribution of Rust, but by moving it out of the standard library it makes libstd that much more portable to more platforms and environments. This conveniently also removes the stuttering of 'std::hashmap::HashMap', although 'collections::HashMap' is only one character shorter.
2014-02-21auto merge of #12422 : alexcrichton/rust/buffered-default, r=brsonbors-1/+1
One of the most common ways to use the stdin stream is to read it line by line for a small program. In order to facilitate this common usage pattern, this commit changes the stdin() function to return a BufferedReader by default. A new `stdin_raw()` method was added to get access to the raw unbuffered stream. I have not changed the stdout or stderr methods because they are currently unable to flush in their destructor, but #12403 should have just fixed that.
2014-02-21auto merge of #12411 : Arcterus/rust/time, r=alexcrichtonbors-27/+23
More work towards finishing #8784.
2014-02-21Move time out of extra (cc #8784)Arcterus-27/+23
2014-02-22Move std::num::Integer to libnumBrendan Zabarauskas-0/+1
2014-02-20Return a buffered stdin by default.Alex Crichton-1/+1
One of the most common ways to use the stdin stream is to read it line by line for a small program. In order to facilitate this common usage pattern, this commit changes the stdin() function to return a BufferedReader by default. A new `stdin_raw()` method was added to get access to the raw unbuffered stream. I have not changed the stdout or stderr methods because they are currently unable to flush in their destructor, but #12403 should have just fixed that.
2014-02-17Remove CloneableTuple and ImmutableTuple traitsBrendan Zabarauskas-2/+2
These are adequately covered by the Tuple2 trait.
2014-02-17Improve naming of tuple getters, and add mutable tuple getterBrendan Zabarauskas-1/+1
Renames the `n*` and `n*_ref` tuple getters to `val*` and `ref*` respectively, and adds `mut*` getters.
2014-02-15auto merge of #12272 : alexcrichton/rust/snapshot, r=kballardbors-30/+30
This notably contains the `extern mod` => `extern crate` change. Closes #9880
2014-02-15Clean up the Perlin noise benchmarkBen Striegel-65/+49
2014-02-14extern mod => extern crateAlex Crichton-30/+30
This was previously implemented, and it just needed a snapshot to go through
2014-02-13Removed num::OrderableMichael Darakananda-2/+2
2014-02-11Rewrite channels yet again for upgradeabilityAlex Crichton-11/+11
This, the Nth rewrite of channels, is not a rewrite of the core logic behind channels, but rather their API usage. In the past, we had the distinction between oneshot, stream, and shared channels, but the most recent rewrite dropped oneshots in favor of streams and shared channels. This distinction of stream vs shared has shown that it's not quite what we'd like either, and this moves the `std::comm` module in the direction of "one channel to rule them all". There now remains only one Chan and one Port. This new channel is actually a hybrid oneshot/stream/shared channel under the hood in order to optimize for the use cases in question. Additionally, this also reduces the cognitive burden of having to choose between a Chan or a SharedChan in an API. My simple benchmarks show no reduction in efficiency over the existing channels today, and a 3x improvement in the oneshot case. I sadly don't have a pre-last-rewrite compiler to test out the old old oneshots, but I would imagine that the performance is comparable, but slightly slower (due to atomic reference counting). This commit also brings the bonus bugfix to channels that the pending queue of messages are all dropped when a Port disappears rather then when both the Port and the Chan disappear.
2014-02-11Change `xfail` directives in compiletests to `ignore`, closes #11363Florian Hahn-21/+21
2014-02-11Factoring bigint, rational, and complex out of libextra into libnum.Felix S. Klock II-2/+2
Removed use of globs present in earlier versions of modules. Fix tutorial.md to reflect `extra::rational` ==> `num::rational`.
2014-02-11Move replace and swap to std::mem. Get rid of std::utilEdward Wang-5/+5
Also move Void to std::any, move drop to std::mem and reexport in prelude.
2014-02-09std: Add init and uninit to mem. Replace direct intrinsic usageBrian Anderson-1/+1
2014-02-07Added tests to make tidyDerek Guenther-0/+70
2014-02-07moved collections from libextra into libcollectionsHeroesGrave-5/+9