smallrye / smallrye-common

Common utilities for SmallRye
Apache License 2.0
23 stars 25 forks source link

Fast-path cache line detection via sys prop #370

Open franz1981 opened 1 day ago

franz1981 commented 1 day ago

Detecting cache line can be memory and cpu intensive as it is now, involving reading (in-memory) files (in linux) or spawing new processes (on MacOS): in JCTools we save all of this via https://github.com/JCTools/JCTools/blob/a17b56f09cc9ec7d773707578c89f3ca9c11f968/jctools-core/src/main/java/org/jctools/util/PortableJvmInfo.java#L21

  1. having a sys prop allow users which support specific archs to save these checks to ever be performed
  2. some of these things doesn't change by long time for most architectures
franz1981 commented 1 day ago

@radcortez you can add more data about why is costy here, if you wish