diff options
| author | Björn Steinbrink <bsteinbr@gmail.com> | 2013-05-14 20:32:49 +0200 |
|---|---|---|
| committer | Björn Steinbrink <bsteinbr@gmail.com> | 2013-05-14 20:32:49 +0200 |
| commit | 7ba685c7abe3f4e76d7e720277c1070c4dafb88b (patch) | |
| tree | 2834ea782163c29e96c7a8336a55625cc027b6d2 /src/libsyntax | |
| parent | 767e3ae86cba26437a60009d79ac2a295b41768e (diff) | |
| download | rust-7ba685c7abe3f4e76d7e720277c1070c4dafb88b.tar.gz rust-7ba685c7abe3f4e76d7e720277c1070c4dafb88b.zip | |
Add inlining for iter_bytes for types used as hashmap keys
Not inlining these affects the hash table performance quite badly.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/token.rs | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 94bd9a18589..34480bb1edf 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -98,12 +98,14 @@ impl<D:Decoder> Decodable<D> for ident { #[cfg(stage0)] impl to_bytes::IterBytes for ident { + #[inline(always)] fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) { self.repr.iter_bytes(lsb0, f) } } #[cfg(not(stage0))] impl to_bytes::IterBytes for ident { + #[inline(always)] fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool { self.repr.iter_bytes(lsb0, f) } diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 27686c4e4aa..fe479ab81f7 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -357,12 +357,14 @@ impl<'self> Equiv<@~str> for StringRef<'self> { #[cfg(stage0)] impl<'self> to_bytes::IterBytes for StringRef<'self> { + #[inline(always)] fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) { (**self).iter_bytes(lsb0, f); } } #[cfg(not(stage0))] impl<'self> to_bytes::IterBytes for StringRef<'self> { + #[inline(always)] fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool { (**self).iter_bytes(lsb0, f) } |
