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) => dataToBeProcessed.zipWithIndex.map { case (data, idx) =>
    if(0 != idx && 0 == idx % divisor) log.info(s"$idx records are processed")
    elapsed { toolbox.eval(q"$symbol.function($data)").asInstanceOf[AnObject] }
  }
  case None => 
}

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

Thanks

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

Take a look at https://github.com/MasseGuillaume/ScalaKata2/blob/master/evaluation/src/main/scala/com.scalakata.evaluation/Evaluator.scala#L18