Scala eval performance

When testing with Scala’s parse, eval functions, it seems the execution is a bit slow. For 16428 records it took 743.385 seconds (roughly 22 records/ second).

// cache a toolbox symbol in a map before eval() 
cache.get(path) match {
  case Some(symbol) => { case (data, idx) =>
    if(0 != idx && 0 == idx % divisor)"$idx records are processed")
    elapsed { toolbox.eval(q"$symbol.function($data)").asInstanceOf[AnObject] }
  case None => 

I read that meta lib ( can perform equivalent functions, and is fast. How can I achieve the same effect (what APIs to called)? Checking its doc ( doesn’t find similar example.


The most reliable way to evaluate Scala code is to use the Scala compiler.

Take a look at