the code we need to change about the WrappedArray creation is in UnCurry.scala, transformVarargs.
for the empty case, current implementation won't generate empty array everytime, it uses Nil as the sequence (no extra array and WrappedArray created).
question:
equality ofRef0, ofRef1, ofRef2... need to compare with ofRef
we only save some cost to create array, we still need to create the wrapped array, which fits the (X*) ==> (Seq[X]) generated by the scala compiler
generic wrapped array - handled but need to spend some more time to see what cases it covers
performance test - compile akka/actor 20s vs original 22s
but we need to recompile the scalac compiler with the new built version, then compile the other projects, because the change impatcs more on runtime than the compile time
def r0: Regex = new Regex(toString)
generates
as it is implicitely def r: Regex = new Regex(toString, mutable.WrappedArray.empty[String] : _*)
we could go firther than that and generate the optimsed target, but that is harder