rust/src/libsyntax_ext
Björn Steinbrink 0eeb14eaba Improve derived implementations for enums with lots of fieldless variants
A number of trait methods like PartialEq::eq or Hash::hash don't
actually need a distinct arm for each variant, because the code within
the arm only depends on the number and types of the fields in the
variants. We can easily exploit this fact to create less and better
code for enums with multiple variants that have no fields at all, the
extreme case being C-like enums.

For nickel.rs and its by now infamous 800 variant enum, this reduces
optimized compile times by 25% and non-optimized compile times by 40%.
Also peak memory usage is down by almost 40% (310MB down to 190MB).

To be fair, most other crates don't benefit nearly as much, because
they don't have as huge enums. The crates in the Rust distribution that
I measured saw basically no change in compile times (I only tried
optimized builds) and only 1-2% reduction in peak memory usage.
2016-05-12 21:05:13 +02:00
..
deriving Improve derived implementations for enums with lots of fieldless variants 2016-05-12 21:05:13 +02:00
asm.rs std: Stabilize APIs for the 1.9 release 2016-04-11 08:57:53 -07:00
Cargo.toml fix cargo.toml for new dependency 2016-03-25 14:39:24 -04:00
cfg.rs Cut out a bunch of Result and panictry! boilerplate from libsyntax. 2015-12-31 14:29:02 +13:00
concat.rs [breaking-change] don't pub export ast::IntLitType variants 2016-02-11 12:34:48 +01:00
concat_idents.rs syntax: Get rid of token::IdentStyle 2016-04-24 20:59:44 +03:00
env.rs [breaking-change] don't glob export ast::Mutablity variants 2016-02-11 12:34:48 +01:00
format.rs syntax: Merge keywords and remaining special idents in one list 2016-04-24 20:59:44 +03:00
lib.rs std: Stabilize APIs for the 1.9 release 2016-04-11 08:57:53 -07:00
log_syntax.rs Move built-in syntax extensions to a separate crate 2015-12-15 15:04:46 +09:00
trace_macros.rs Move built-in syntax extensions to a separate crate 2015-12-15 15:04:46 +09:00