Skip to content

[NativeAOT] EventPipe current_thread_get_id performance #86828

@jkotas

Description

@jkotas
          Mono implementation of this method just returns `pthread_self` that is the opaque thread ID and that is very cheap to get (it just returns thread local static):

return mono_native_thread_id_get ();

return pthread_self ();

Similarly, the CoreCLR implementation built on top of Win32 PAL emulator is fairly cheap.

PalGetCurrentThreadIdForLogging is implemented as a raw syscall(SYS_gettid) that will be at least 100x more expensive than pthread_self.

This smells like a pretty significant performance issue.

Originally posted by @jkotas in #86226 (comment)

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions