<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_data_structures/src/sync, branch 1.72.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.72.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.72.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2023-05-18T03:14:45+00:00</updated>
<entry>
<title>Remove unused `impl&lt;T&gt; WorkerLocal&lt;Vec&lt;T&gt;&gt;`.</title>
<updated>2023-05-18T03:14:45+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-05-18T03:14:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9bfb90b1bed203a6df2850173f6fb30464e99645'/>
<id>urn:sha1:9bfb90b1bed203a6df2850173f6fb30464e99645</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #107782 - Zoxc:worker-local, r=cjgillot</title>
<updated>2023-04-27T17:43:09+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2023-04-27T17:43:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c14882f74e8feb3f76ae85ed5cd66afaccd1da67'/>
<id>urn:sha1:c14882f74e8feb3f76ae85ed5cd66afaccd1da67</id>
<content type='text'>
Move the WorkerLocal type from the rustc-rayon fork into rustc_data_structures

This PR moves the definition of the `WorkerLocal` type from `rustc-rayon` into `rustc_data_structures`. This is enabled by the introduction of the `Registry` type which allows you to group up threads to be used by `WorkerLocal` which is basically just an array with an per thread index. The `Registry` type mirrors the one in Rayon and each Rayon worker thread is also registered with the new `Registry`. Safety for `WorkerLocal` is ensured by having it keep a reference to the registry and checking on each access that we're still on the group of threads associated with the registry used to construct it.

Accessing a `WorkerLocal` is micro-optimized due to it being hot since it's used for most arena allocations.

Performance is slightly improved for the parallel compiler:
&lt;table&gt;&lt;tr&gt;&lt;td rowspan="2"&gt;Benchmark&lt;/td&gt;&lt;td colspan="1"&gt;&lt;b&gt;Before&lt;/b&gt;&lt;/th&gt;&lt;td colspan="2"&gt;&lt;b&gt;After&lt;/b&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align="right"&gt;Time&lt;/td&gt;&lt;td align="right"&gt;Time&lt;/td&gt;&lt;td align="right"&gt;%&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;🟣 &lt;b&gt;clap&lt;/b&gt;:check&lt;/td&gt;&lt;td align="right"&gt;1.9992s&lt;/td&gt;&lt;td align="right"&gt;1.9949s&lt;/td&gt;&lt;td align="right"&gt; -0.21%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;🟣 &lt;b&gt;hyper&lt;/b&gt;:check&lt;/td&gt;&lt;td align="right"&gt;0.2977s&lt;/td&gt;&lt;td align="right"&gt;0.2970s&lt;/td&gt;&lt;td align="right"&gt; -0.22%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;🟣 &lt;b&gt;regex&lt;/b&gt;:check&lt;/td&gt;&lt;td align="right"&gt;1.1335s&lt;/td&gt;&lt;td align="right"&gt;1.1315s&lt;/td&gt;&lt;td align="right"&gt; -0.18%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;🟣 &lt;b&gt;syn&lt;/b&gt;:check&lt;/td&gt;&lt;td align="right"&gt;1.8235s&lt;/td&gt;&lt;td align="right"&gt;1.8171s&lt;/td&gt;&lt;td align="right"&gt; -0.35%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;🟣 &lt;b&gt;syntex_syntax&lt;/b&gt;:check&lt;/td&gt;&lt;td align="right"&gt;6.9047s&lt;/td&gt;&lt;td align="right"&gt;6.8930s&lt;/td&gt;&lt;td align="right"&gt; -0.17%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Total&lt;/td&gt;&lt;td align="right"&gt;12.1586s&lt;/td&gt;&lt;td align="right"&gt;12.1336s&lt;/td&gt;&lt;td align="right"&gt; -0.21%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Summary&lt;/td&gt;&lt;td align="right"&gt;1.0000s&lt;/td&gt;&lt;td align="right"&gt;0.9977s&lt;/td&gt;&lt;td align="right"&gt; -0.23%&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

cc `@SparrowLii`
</content>
</entry>
<entry>
<title>Split `{Idx, IndexVec, IndexSlice}` into their own modules</title>
<updated>2023-04-24T13:53:35+00:00</updated>
<author>
<name>Maybe Waffle</name>
<email>waffle.lapkin@gmail.com</email>
</author>
<published>2023-04-19T10:57:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e496fbec922b22d9b506ba55386c482b4bf06378'/>
<id>urn:sha1:e496fbec922b22d9b506ba55386c482b4bf06378</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Move the WorkerLocal type from the rustc-rayon fork into rustc_data_structures</title>
<updated>2023-04-16T03:50:57+00:00</updated>
<author>
<name>John Kåre Alsaker</name>
<email>john.kare.alsaker@gmail.com</email>
</author>
<published>2020-10-31T11:01:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=64474a40b0273557dbea58ca29af9245cbb4ad87'/>
<id>urn:sha1:64474a40b0273557dbea58ca29af9245cbb4ad87</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix some clippy::complexity</title>
<updated>2023-04-09T21:22:14+00:00</updated>
<author>
<name>Nilstrieb</name>
<email>48135649+Nilstrieb@users.noreply.github.com</email>
</author>
<published>2023-04-09T21:07:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=81c320ea7786a2b5a07a165aedacb438ae14fd74'/>
<id>urn:sha1:81c320ea7786a2b5a07a165aedacb438ae14fd74</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Another AppendOnlyVec</title>
<updated>2023-04-04T09:01:44+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>git-spam-no-reply9815368754983@oli-obk.de</email>
</author>
<published>2023-03-14T12:30:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a1d20cf7a20eb69b7a48c9897dfd8e9a3e4b6360'/>
<id>urn:sha1:a1d20cf7a20eb69b7a48c9897dfd8e9a3e4b6360</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Replace another lock with an append-only vec</title>
<updated>2023-04-04T09:01:44+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>git-spam-no-reply9815368754983@oli-obk.de</email>
</author>
<published>2023-03-14T12:16:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7edd1d8799aff9d4dfea72e37c500ec8fdb0afb8'/>
<id>urn:sha1:7edd1d8799aff9d4dfea72e37c500ec8fdb0afb8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Remove a lock in favor of an AppendOnlyVec</title>
<updated>2023-04-04T09:01:44+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>git-spam-no-reply9815368754983@oli-obk.de</email>
</author>
<published>2023-03-14T12:11:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=46996326377b100fa461b49b5be0c91a075f55e5'/>
<id>urn:sha1:46996326377b100fa461b49b5be0c91a075f55e5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add a usize-indexed append-only-vec</title>
<updated>2023-04-04T09:01:44+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>git-spam-no-reply9815368754983@oli-obk.de</email>
</author>
<published>2023-03-14T11:51:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=daee746771f12f58f707787e8075d9f89ec0511d'/>
<id>urn:sha1:daee746771f12f58f707787e8075d9f89ec0511d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use a lock-free datastructure for `source_span`</title>
<updated>2023-02-21T08:38:24+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>git-spam-no-reply9815368754983@oli-obk.de</email>
</author>
<published>2023-02-21T08:37:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=decfb4d123651a0673db47542e18ca60d1c501ac'/>
<id>urn:sha1:decfb4d123651a0673db47542e18ca60d1c501ac</id>
<content type='text'>
</content>
</entry>
</feed>
