Skip to content

Instantly share code, notes, and snippets.

View Ichoran's full-sized avatar
💭
Ichoran is diffracting imperceptibly (more, with JPEG artifacts)

Ichoran

💭
Ichoran is diffracting imperceptibly (more, with JPEG artifacts)
View GitHub Profile
@Ichoran
Ichoran / ThreadLocalLoom.scala
Created October 16, 2024 06:29
Benchmark to test whether ThreadLocal creation (via DynamicVariable) really impacts Loom threads
//> using scala 3.5.0
//> using dep com.github.ichoran::kse3-basics:0.3.11
//> using dep com.github.ichoran::kse3-flow:0.3.11
// Run with scala-cli --power --jmh --jvm=21 ThreadLocalLoom.scala
// If you change the classes that have to be benchmarked, you may have to rm -r .scala_build
package threadlocalloom.bench
@Ichoran
Ichoran / Macros.scala
Created March 11, 2025 21:37
Macro solution to context function default argument evaluation
/> using scala 3.6.4
package examplecontextmacro
object DoNotUse {
def __do_not_use__ : Nothing = throw new Exception("Do not use!")
}
object MacroImpl {
import scala.quoted.*