<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/std, branch perf-tmp</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=perf-tmp</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=perf-tmp'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-10-02T08:27:48+00:00</updated>
<entry>
<title>Rollup merge of #146281 - Jules-Bertholet:static-align-thread-local, r=Mark-Simulacrum</title>
<updated>2025-10-02T08:27:48+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-10-02T08:27:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=92aac1bdf61642cfc99498ca86e663cf53d2039e'/>
<id>urn:sha1:92aac1bdf61642cfc99498ca86e663cf53d2039e</id>
<content type='text'>
Support `#[rustc_align_static]` inside `thread_local!`

Tracking issue: rust-lang/rust#146177

```rust
thread_local! {
    #[rustc_align_static(64)]
    static SO_ALIGNED: u64 = const { 0 };
}
```

This increases the amount of recursion the macro performs (once per attribute in addition to the previous once per item), making it easier to hit the recursion limit. I’ve added workarounds to limit the impact in the case of long doc comments, but this still needs a crater run just in case.

r? libs

``@rustbot`` label A-attributes A-macros A-thread-locals F-static_align T-libs
</content>
</entry>
<entry>
<title>Fix memory leak in `os` impl</title>
<updated>2025-10-01T16:28:18+00:00</updated>
<author>
<name>Jules Bertholet</name>
<email>julesbertholet@quoi.xyz</email>
</author>
<published>2025-10-01T15:32:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=94f00f4e4a0240bc7b8284c78482e37af252309a'/>
<id>urn:sha1:94f00f4e4a0240bc7b8284c78482e37af252309a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #147213 - ivmarkov:fix-hostname-espidf, r=joboet</title>
<updated>2025-10-01T12:15:03+00:00</updated>
<author>
<name>Stuart Cook</name>
<email>Zalathar@users.noreply.github.com</email>
</author>
<published>2025-10-01T12:15:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=06e059d45d53d82654cad67eff3905c0577e36ab'/>
<id>urn:sha1:06e059d45d53d82654cad67eff3905c0577e36ab</id>
<content type='text'>
Fix broken STD build for ESP-IDF

PRs rust-lang/rust#147162 and rust-lang/rust#146937 did [broke](https://github.com/esp-rs/esp-idf-sys/actions/runs/18151791720/job/51663969786) the STD build for `target_os = "espidf"` because that target [does not have neither a `gethostname`, not a `libc::_SC_HOST_NAME_MAX` by default](https://github.com/espressif/esp-idf/issues/14849).

While there is a [3rd party component for this syscall](https://components.espressif.com/components/espressif/sock_utils/versions/0.2.2/readme) in the ESP-IDF component registry, I don't think we should use it, because it does not come with ESP-IDF by default.

Therefore, the one-liner fix just re-routes ESP-IDF into the `unsupported` branch.
</content>
</entry>
<entry>
<title>Fix broken STD build for ESP-IDF</title>
<updated>2025-10-01T08:12:44+00:00</updated>
<author>
<name>ivmarkov</name>
<email>ivan.markov@gmail.com</email>
</author>
<published>2025-10-01T08:12:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b1c212f8502e8e7fcb66da0e8da98db770cb7c02'/>
<id>urn:sha1:b1c212f8502e8e7fcb66da0e8da98db770cb7c02</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #147198 - matthiaskrgr:rollup-b0ryvvu, r=matthiaskrgr</title>
<updated>2025-10-01T04:46:14+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2025-10-01T04:46:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1e1a39441bd11aba541a48ba714d939490fc7b85'/>
<id>urn:sha1:1e1a39441bd11aba541a48ba714d939490fc7b85</id>
<content type='text'>
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#143069 (Add fast-path for accessing the current thread id)
 - rust-lang/rust#146518 (Improve the documentation around `ZERO_AR_DATE`)
 - rust-lang/rust#146596 (Add a dummy codegen backend)
 - rust-lang/rust#146617 (Don’t suggest foreign `doc(hidden)` types in "the following other types implement trait" diagnostics)
 - rust-lang/rust#146635 (cg_llvm: Stop using `as_c_char_ptr` for coverage-related bindings)
 - rust-lang/rust#147184 (Fix the bevy implied bounds hack for the next solver)

r? `@ghost`
`@rustbot` modify labels: rollup
</content>
</entry>
<entry>
<title>Add fast-path for accessing the current thread id</title>
<updated>2025-09-30T18:51:03+00:00</updated>
<author>
<name>Josh Simmons</name>
<email>josh@nega.tv</email>
</author>
<published>2025-06-26T19:31:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=cbaec31c10c5eff7342e5273360521911fbf7631'/>
<id>urn:sha1:cbaec31c10c5eff7342e5273360521911fbf7631</id>
<content type='text'>
Accessing the thread id is often used in profiling and debugging, as
well as some approaches for sound single-threaded access to data.

Currently the only way to access the thread id is by first obtaining a
handle to the current thread. While this is not exactly slow, it does
require an atomic inc-ref and dec-ref operation, as well as the
injection of `Thread`'s drop code into the caller.

This publicly exposes the existing fast-path for accessing the current
thread id.
</content>
</entry>
<entry>
<title>Rollup merge of #142506 - clarfonthey:path-trailing-sep, r=joboet</title>
<updated>2025-09-30T18:46:44+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-09-30T18:46:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=61b9467af89c18fb2b1e08da1fce2472b2147cc1'/>
<id>urn:sha1:61b9467af89c18fb2b1e08da1fce2472b2147cc1</id>
<content type='text'>
Add `Path::has_trailing_sep` and related methods

Implements rust-lang/libs-team#335.

Tracking issue: rust-lang/rust#142503

Notable differences from ACP:

* `trim_trailing_sep` was added to `Path` since it felt reasonable to ensure that the inverse operation was available.
* Per suggestion of `@kennytm,` added `push_trailing_sep` and `pop_trailing_sep` to `PathBuf` in addition to `set_trailing_sep`.

This also updates some of the docs on various `Path` methods to use the term "trailing separator" instead of "trailing slash" for consistency.
</content>
</entry>
<entry>
<title>Rollup merge of #146937 - joboet:gethostname, r=Mark-Simulacrum</title>
<updated>2025-09-29T19:42:41+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-09-29T19:42:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8223831942e7668d890955a1a67a69e49c286e3d'/>
<id>urn:sha1:8223831942e7668d890955a1a67a69e49c286e3d</id>
<content type='text'>
std: implement `hostname`

Resolves https://github.com/rust-lang/libs-team/issues/330
Tracking issue: https://github.com/rust-lang/rust/issues/135142

This is based on rust-lang/rust#135141, but I've reimplemented the UNIX version, which now:
* uses `sysconf(_SC_HOST_NAME_MAX)` as an initial buffer length
* returns `OutOfMemory` if the `Vec` allocation fails
* retries the operation if it detects that the name returned by `gethostname` was truncated

Additionally, as part of the rebase, I had to move some WinSock abstractions (initialisation and error access) to `sys::pal` so that they can be accessed from `sys::net::hostname`.

CC ``@orowith2os`` (and thank you for your work!)
</content>
</entry>
<entry>
<title>std: implement `hostname`</title>
<updated>2025-09-29T08:24:54+00:00</updated>
<author>
<name>joboet</name>
<email>jonasboettiger@icloud.com</email>
</author>
<published>2025-09-23T15:14:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=97333f8c9a0f774cc8d0025bbc51848e1f60427d'/>
<id>urn:sha1:97333f8c9a0f774cc8d0025bbc51848e1f60427d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #147090 - Noratrieb:immediate-abort-stack-overflow, r=joboet</title>
<updated>2025-09-29T01:32:14+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2025-09-29T01:32:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=772f380092b30680313b70a622cafc17f03e6bff'/>
<id>urn:sha1:772f380092b30680313b70a622cafc17f03e6bff</id>
<content type='text'>
Skip stack overflow handler for panic=immediate-abort

std installs guard pages and a signal handler to ensure that stackoverflows 1) terminate abruptly and 2) print an nice message. Even for panic=immediate-abort, 1) is desirable, we don't want silent data corruption there. But 2) is completely unnecessary, as users deliberately *don't* want nice messages, they want minimum binary size.

Therefore, skip the entire guard signal handler setup, which saves a lot of bytes.

I tested this with a hello world binary using fat LTO, build-std, panic=immediate-abort, opt-level=s, strip=debuginfo.

`size` reports significant savings:

```
   text	   data	    bss	    dec	    hex	filename
  15252	   1032	    104	  16388	   4004	tiny-before
   6881	    964	     48	   7893	   1ed5	tiny-after2
```

`nm -U` goes from 71 to 56, getting rid of a bunch of stack overflow related symbols. The disk size goes from `31k` to `24k`.

The impact on the error message is minimal, as the message was already
missing.

before:
```
fish: Job 1, './tiny-so-before' terminated by signal SIGABRT (Abort)
```

after:
```
fish: Job 1, './tiny-so-after' terminated by signal SIGSEGV (Address boundary error)
```

I didn't test the Windows part, but it likely also has savings.
</content>
</entry>
</feed>
