Internals: Why does compose not use java.lang.Thre...
# compose
m
Internals: Why does compose not use java.lang.ThreadLocal on JVM, but a custom ThreadLocal implementation?
a
Compose does use java.lang.ThreadLocal on JVM, just through a wrapper. You can't directly use a JVM-specific class in multiplatform common code.
m
Ok, it does define an external/actual for ThreadLocal, although I have not found any usage of it. The question should be why a
SnapshotThreadLocal
is there`.` But as I see now it is already documented - it has lower overhead than JVM/ART implementation.