rust/src
kennytm 445718084f
Rollup merge of #53521 - alexcrichton:optimize-lit-token, r=michaelwoerister
syntax: Optimize some literal parsing

Currently in the `wasm-bindgen` project we have a very very large crate that's
procedurally generated, `web-sys`. To generate this crate we parse all of a
browser's WebIDL and we then generate bindings for all of the APIs contained
within.

The resulting Rust file is 18MB large (wow!) and currently takes a very long
time to compile in debug mode. On the nightly compiler a *debug* build takes 90s
for the crate to finish. I was curious what was taking so long and upon
investigating a *massive* portion of the time was spent in the `lit_token`
method of the compiler, primarily formatting strings via `format!`.

Upon some more investigation it looks like the `byte_str_lit` was allocating an
error message once per byte, causing a very large number of allocations to
happen for large literals, of which wasm-bindgen generates quite a few (some are
MB large).

This commit fixes the issue by lazily allocating the error message, only doing
so if the error message is actually needed (which should be never). As a result,
the debug mode compilation time for our `web-sys` crate decreased from 90s to
20s, a very nice improvement! (although we've still got some work to do).
2018-08-21 17:51:52 +08:00
..
bootstrap
build_helper
ci
dlmalloc@c99638dc2e
doc Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
etc
grammar
jemalloc@1f5a28755e
liballoc
liballoc_jemalloc
liballoc_system
libarena
libbacktrace@f4d02bbdbf
libcompiler_builtins@d549d85b17
libcore Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
libfmt_macros
libgraphviz
liblibc@6bdbf5dc93
libpanic_abort
libpanic_unwind
libproc_macro Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
libprofiler_builtins
librustc Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
librustc_allocator mv (mod) codemap source_map 2018-08-19 23:01:00 +02:00
librustc_apfloat
librustc_asan
librustc_borrowck mv codemap() source_map() 2018-08-19 23:01:01 +02:00
librustc_codegen_llvm Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
librustc_codegen_utils
librustc_cratesio_shim
librustc_data_structures Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
librustc_driver mv codemap source_map 2018-08-19 23:01:01 +02:00
librustc_errors fix tidy errors 2018-08-19 23:01:01 +02:00
librustc_fs_util
librustc_incremental mv codemap() source_map() 2018-08-19 23:01:01 +02:00
librustc_lint Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
librustc_llvm
librustc_lsan
librustc_metadata Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
librustc_metadata_utils
librustc_mir Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
librustc_msan
librustc_passes mv (mod) codemap source_map 2018-08-19 23:01:00 +02:00
librustc_platform_intrinsics
librustc_plugin
librustc_privacy
librustc_resolve Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
librustc_save_analysis mv codemap() source_map() 2018-08-19 23:01:01 +02:00
librustc_target Auto merge of #52101 - japaric:linker-flavor, r=alexcrichton 2018-08-20 01:12:58 +00:00
librustc_traits Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
librustc_tsan
librustc_typeck Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
librustdoc Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
libserialize Rollup merge of #53393 - BurntPizza:serialize-inlines, r=alexcrichton 2018-08-21 17:51:40 +08:00
libstd Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
libsyntax Rollup merge of #53521 - alexcrichton:optimize-lit-token, r=michaelwoerister 2018-08-21 17:51:52 +08:00
libsyntax_ext Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
libsyntax_pos Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
libterm
libtest
libunwind
llvm@e19f07f5a6
llvm-emscripten@2717444753
rtstartup
rustc
rustllvm
stdsimd@05c2f61c38
test Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor 2018-08-21 17:51:49 +08:00
tools Rollup merge of #53492 - danc86:lld-riscv, r=alexcrichton 2018-08-21 17:51:48 +08:00
Cargo.lock
Cargo.toml
README.md
stage0.txt

This directory contains the source code of the rust project, including:

  • rustc and its tests
  • libstd
  • Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the rustc guide.

Their is also useful content in the following READMEs, which are gradually being moved over to the guide: