rust/src
bors c639a78dc4 auto merge of #5205 : thestinger/rust/radix, r=graydon
This is an implementation of a map and set for integer keys. It's an ordered container (by byte order, which is sorted order for integers and byte strings when done in the right direction) with O(1) worst-case lookup, removal and insertion. There's no rebalancing or rehashing so it's actually O(1) without amortizing any costs.

The fanout can be adjusted in multiples of 2 from 2-ary through 256-ary, but it's hardcoded at 16-ary because there isn't a way to expose that in the type system yet. To keep things simple, it also only allows `uint` keys, but later I'll expand it to all the built-in integer types and byte arrays.

There's quite a bit of room for performance improvement, along with the boost that will come with dropping the headers on `Owned` `~` and getting rid of the overhead from the stack switches to the allocator. It currently does suffix compression for a single node and then splits into two n-ary trie nodes, which could be replaced with an array for at least 4-8 suffixes before splitting it. There's also the option of doing path compression, which may be a good or a bad idea and depends a lot on the data stored.

I want to share the test suite with the other maps so that's why I haven't duplicated all of the existing integer key tests in this file. I'll send in another pull request to deal with that.

Current benchmark numbers against the other map types:

    TreeMap:
     Sequential integers:
      insert: 0.798295
      search: 0.188931
      remove: 0.435923
     Random integers:
      insert: 1.557661
      search: 0.758325
      remove: 1.720527

    LinearMap:
     Sequential integers:
      insert: 0.272338
      search: 0.141179
      remove: 0.190273
     Random integers:
      insert: 0.293588
      search: 0.162677
      remove: 0.206142

    TrieMap:
     Sequential integers:
      insert: 0.0901
      search: 0.012223
      remove: 0.084139
     Random integers:
      insert: 0.392719
      search: 0.261632
      remove: 0.470401

@graydon is using an earlier version of this for the garbage collection implementation, so that's why I added this to libcore. I left out the `next` and `prev` methods *for now* because I just wanted the essentials first.
2013-03-04 08:21:47 -08:00
..
compiletest librustdoc: Remove fn@, fn~, and fn& from compiletest, fuzzer, rustdoc, and rt. rs=defun 2013-03-02 18:47:47 -08:00
driver Added rust convenience tool similar to go's go tool 2013-02-18 23:11:08 +01:00
etc etc: Suppress another Valgrind issue. rs=burningtree 2013-03-03 10:30:00 -08:00
libcore auto merge of #5205 : thestinger/rust/radix, r=graydon 2013-03-04 08:21:47 -08:00
libfuzzer librustdoc: Remove fn@, fn~, and fn& from compiletest, fuzzer, rustdoc, and rt. rs=defun 2013-03-02 18:47:47 -08:00
librust librustc: Forbid chained imports and fix the logic for one-level renaming imports 2013-03-02 16:49:30 -08:00
librustc rustc: implement MIPS O32 ABI 2013-03-03 20:02:03 -08:00
librustdoc librustdoc: Remove fn@, fn~, and fn& from compiletest, fuzzer, rustdoc, and rt. rs=defun 2013-03-02 18:47:47 -08:00
librusti librustc: "APL2" -> "ASL2". rs=license-fix 2013-03-01 08:41:31 -08:00
librustpkg librustdoc: Remove fn@, fn~, and fn& from compiletest, fuzzer, rustdoc, and rt. rs=defun 2013-03-02 18:47:47 -08:00
libstd rustc: MIPS32 support 2013-03-03 19:27:27 -08:00
libsyntax libsyntax: deny deprecated_self in libsyntax 2013-03-03 15:25:08 -08:00
libuv@da33bba7c0 build: change libuv to point at joyent's repo and make unpatched build libuv work on mingw 2013-02-10 11:51:05 -08:00
llvm@accc36b3e3 llvm: fork to disable LiveIRVariabes in GCStrategy. 2012-11-14 18:21:09 -08:00
rt rt: fix some bugs for MIPS target 2013-03-03 20:02:06 -08:00
rustllvm There is no function in LLVM called LLVMInitializeMipsAsmLexer 2013-03-03 20:02:06 -08:00
test test: Remove fn@, fn~, and fn& from the test suite. rs=defun 2013-03-02 18:47:47 -08:00
README.txt Rename cargo to rustpkg and start over fresh 2013-02-15 18:04:10 -08:00
snapshots.txt Register FreeBSD snapshot 2013-03-01 17:23:25 -08:00

This is a preliminary version of the Rust compiler, libraries and tools

Source layout:

librustc/          The self-hosted compiler

libcore/           The core library (imported and linked by default)
libstd/            The standard library (slightly more peripheral code)
libsyntax/         The Rust parser and pretty-printer

rt/                The runtime system
rt/rust_*.cpp      - The majority of the runtime services
rt/isaac           - The PRNG used for pseudo-random choices in the runtime
rt/bigint          - The bigint library used for the 'big' type
rt/uthash          - Small hashtable-and-list library for C, used in runtime
rt/sync            - Concurrency utils
rt/util            - Small utility classes for the runtime.
rt/vg              - Valgrind headers
rt/msvc            - MSVC support
rt/linenoise       - a readline-like line editing library

test/              Testsuite
test/compile-fail  - Tests that should fail to compile
test/run-fail      - Tests that should compile, run and fail
test/run-pass      - Tests that should compile, run and succeed
test/bench         - Benchmarks and miscellanea
test/pretty        - Pretty-printer tests
test/auxiliary     - Dependencies of tests

compiletest/       The test runner

librustpkg/        The package manager and build system

librusti/          The JIT REPL

librustdoc/        The Rust API documentation tool

llvm/              The LLVM submodule

libuv/             The libuv submodule

rustllvm/          LLVM support code

libfuzzer/         A collection of fuzz testers

etc/               Scripts, editor support, misc