<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/alloc/src/str.rs, branch 1.87.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.87.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.87.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-03-07T19:11:13+00:00</updated>
<entry>
<title>Fully test the alloc crate through alloctests</title>
<updated>2025-03-07T19:11:13+00:00</updated>
<author>
<name>bjorn3</name>
<email>17426603+bjorn3@users.noreply.github.com</email>
</author>
<published>2025-02-06T12:46:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ae5687e4b0a375d3307856fb81810f6cc9019be5'/>
<id>urn:sha1:ae5687e4b0a375d3307856fb81810f6cc9019be5</id>
<content type='text'>
For the tests that make use of internal implementation details, we
include the module to test using #[path] in alloctests now.
</content>
</entry>
<entry>
<title>Inline str::repeat</title>
<updated>2024-11-06T18:54:50+00:00</updated>
<author>
<name>Kornel</name>
<email>kornel@geekhood.net</email>
</author>
<published>2024-11-06T18:54:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5a855654de7ffb09681002ba6685a4234ac0a392'/>
<id>urn:sha1:5a855654de7ffb09681002ba6685a4234ac0a392</id>
<content type='text'>
</content>
</entry>
<entry>
<title>better default capacity for str::replace</title>
<updated>2024-10-22T16:53:33+00:00</updated>
<author>
<name>Laiho</name>
<email>emillaiho@hotmail.fi</email>
</author>
<published>2024-10-19T13:49:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c8391802afc158759dfe234e22f665d39091ea8d'/>
<id>urn:sha1:c8391802afc158759dfe234e22f665d39091ea8d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #130223 - LaihoE:faster_str_replace, r=thomcc</title>
<updated>2024-10-17T16:20:02+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2024-10-17T16:20:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=86bd45979a964678b40b79156744f0057759d840'/>
<id>urn:sha1:86bd45979a964678b40b79156744f0057759d840</id>
<content type='text'>
optimize str.replace

Adds a fast path for str.replace for the ascii to ascii case. This allows for autovectorizing the code. Also should this instead be done with specialization? This way we could remove one branch. I think it is the kind of branch that is easy to predict though.

Benchmark for the fast path (replace all "a" with "b" in the rust wikipedia article, using criterion) :
| N        | Speedup | Time New (ns) | Time Old (ns) |
|----------|---------|---------------|---------------|
| 2        | 2.03    | 13.567        | 27.576        |
| 8        | 1.73    | 17.478        | 30.259        |
| 11       | 2.46    | 18.296        | 45.055        |
| 16       | 2.71    | 17.181        | 46.526        |
| 37       | 4.43    | 18.526        | 81.997        |
| 64       | 8.54    | 18.670        | 159.470       |
| 200      | 9.82    | 29.634        | 291.010       |
| 2000     | 24.34   | 81.114        | 1974.300      |
| 20000    | 30.61   | 598.520       | 18318.000     |
| 1000000  | 29.31   | 33458.000     | 980540.000    |
</content>
</entry>
<entry>
<title>Add fast path for ascii to ascii in str::replace</title>
<updated>2024-09-23T16:24:06+00:00</updated>
<author>
<name>Laiho</name>
<email>emillaiho@hotmail.fi</email>
</author>
<published>2024-09-08T21:58:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4484085b18df4b10243b503a21602bb71836e8b3'/>
<id>urn:sha1:4484085b18df4b10243b503a21602bb71836e8b3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Improve autovectorization of to_lowercase / to_uppercase functions</title>
<updated>2024-09-23T09:31:29+00:00</updated>
<author>
<name>Jörn Horstmann</name>
<email>git@jhorstmann.net</email>
</author>
<published>2024-04-10T20:22:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e393f56d37857d3b690b687fe54e8413bb9d5b3a'/>
<id>urn:sha1:e393f56d37857d3b690b687fe54e8413bb9d5b3a</id>
<content type='text'>
Refactor the code in the `convert_while_ascii` helper function to make
it more suitable for auto-vectorization and also process the full ascii
prefix of the string. The generic case conversion logic will only be
invoked starting from the first non-ascii character.

The runtime on microbenchmarks with ascii-only inputs improves between
1.5x for short and 4x for long inputs on x86_64 and aarch64.

The new implementation also encapsulates all unsafe inside the
`convert_while_ascii` function.

Fixes #123712
</content>
</entry>
<entry>
<title>Reformat using the new identifier sorting from rustfmt</title>
<updated>2024-09-22T23:11:29+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2024-09-22T23:05:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c682aa162b0d41e21cc6748f4fecfe01efb69d1f'/>
<id>urn:sha1:c682aa162b0d41e21cc6748f4fecfe01efb69d1f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Reformat `use` declarations.</title>
<updated>2024-07-28T22:26:52+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-07-28T22:13:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=84ac80f1921afc243d71fd0caaa4f2838c294102'/>
<id>urn:sha1:84ac80f1921afc243d71fd0caaa4f2838c294102</id>
<content type='text'>
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
</content>
</entry>
<entry>
<title>Remove generic lifetime parameter of trait `Pattern`</title>
<updated>2024-07-15T10:12:44+00:00</updated>
<author>
<name>Benoît du Garreau</name>
<email>bdgdlm@outlook.com</email>
</author>
<published>2024-07-08T12:30:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=772315de7c1f68bb95de5a7eb85cb2f167834c53'/>
<id>urn:sha1:772315de7c1f68bb95de5a7eb85cb2f167834c53</id>
<content type='text'>
Use a GAT for `Searcher` associated type because this trait is always
implemented for every lifetime anyway.
</content>
</entry>
<entry>
<title>Simplify `str::clone_into`</title>
<updated>2024-06-25T20:34:41+00:00</updated>
<author>
<name>DaniPopes</name>
<email>57450786+DaniPopes@users.noreply.github.com</email>
</author>
<published>2024-06-25T20:34:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d5ff4f4f657766ca03d7b96553baae6aca053596'/>
<id>urn:sha1:d5ff4f4f657766ca03d7b96553baae6aca053596</id>
<content type='text'>
Removes an `unsafe` in favor of just using `String` methods.
</content>
</entry>
</feed>
