alexcrichton / alexcrichton/scoped-tls

It does not optimize well

Open
#28 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
65
Forks
10
PR merge metrics
No merged PRs in 30d

Description

I think a nested call to `FOO.with` should be cached and create `tlv_get_addr` call only once, but every call becomes `tlv_get_addr` call and it hurts the performance.

```rust
FOO.set(&1, || {
FOO.with(|foo| {
use_foo(foo);

FOO.with(|foo| {
use_foo(foo);

});

});
});
```

I think this code should use some sort of cache for the thread local.

image

This is the actual profiling result

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.