<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_span/src/tests.rs, branch 1.66.1</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.66.1</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.66.1'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2022-06-01T00:36:39+00:00</updated>
<entry>
<title>Lazify `SourceFile::lines`.</title>
<updated>2022-06-01T00:36:39+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2022-05-30T05:59:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0b81d7cdc653f540e9fa219820928184e0273f5f'/>
<id>urn:sha1:0b81d7cdc653f540e9fa219820928184e0273f5f</id>
<content type='text'>
`SourceFile::lines` is a big part of metadata. It's stored in a compressed form
(a difference list) to save disk space. Decoding it is a big fraction of
compile time for very small crates/programs.

This commit introduces a new type `SourceFileLines` which has a `Lines`
form and a `Diffs` form. The latter is used when the metadata is first
read, and it is only decoded into the `Lines` form when line data is
actually needed. This avoids the decoding cost for many files,
especially in `std`. It's a performance win of up to 15% for tiny
crates/programs where metadata decoding is a high part of compilation
costs.

A `Lock` is needed because the methods that access lines data (which can
trigger decoding) take `&amp;self` rather than `&amp;mut self`. To allow for this,
`SourceFile::lines` now takes a `FnMut` that operates on the lines slice rather
than returning the lines slice.
</content>
</entry>
<entry>
<title>Inline implementation of lookup_line</title>
<updated>2021-07-08T21:30:53+00:00</updated>
<author>
<name>Tomasz Miąsko</name>
<email>tomasz.miasko@gmail.com</email>
</author>
<published>2021-07-05T00:00:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1719d4501351eff05299a124dc13846afa2994a0'/>
<id>urn:sha1:1719d4501351eff05299a124dc13846afa2994a0</id>
<content type='text'>
to simplify the implementation and avoid unnecessary
conversions from `Option&lt;usize&gt;` to `isize` and back.
</content>
</entry>
<entry>
<title>mv compiler to compiler/</title>
<updated>2020-08-30T15:45:07+00:00</updated>
<author>
<name>mark</name>
<email>markm@cs.wisc.edu</email>
</author>
<published>2020-08-28T03:58:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9e5f7d5631b8f4009ac1c693e585d4b7108d4275'/>
<id>urn:sha1:9e5f7d5631b8f4009ac1c693e585d4b7108d4275</id>
<content type='text'>
</content>
</entry>
</feed>
