Skip to content

Instantly share code, notes, and snippets.

View tomtau's full-sized avatar

Tomas Tauber tomtau

View GitHub Profile
@tomtau
tomtau / (A*B) + C benchmark
Created September 5, 2013 14:54
Generated job using the old Matrix API
import com.twitter.scalding._
import com.twitter.scalding.mathematics.Matrix
class BenchOldJob(args : Args) extends Job(args) {
import Matrix._
val a0 = Tsv("/home/ttauber/scalding-bench/a0.tsv", ('x, 'y, 'v) )
.read.
toMatrix[Int,Int,Double]('x,'y,'v)
@tomtau
tomtau / (A*B) + C benchmark
Created September 5, 2013 14:56
Generated job using the new Matrix API
import com.twitter.scalding._
import cascading.pipe.joiner._
import com.twitter.scalding.mathematics.Matrix2
import com.twitter.scalding.mathematics.FiniteHint
import com.twitter.algebird.Group
class BenchNewJob(args : Args) extends Job(args) {
import Matrix2._
import com.twitter.scalding.mathematics.MatrixLiteral
@tomtau
tomtau / Graph propagation (common subtrees)
Created September 5, 2013 15:00
Generated job using the old Matrix API
import com.twitter.scalding._
import com.twitter.scalding.mathematics.Matrix
class BenchOldJob(args : Args) extends Job(args) {
import Matrix._
val a0 = Tsv("/home/ttauber/scalding-bench/a0.tsv", ('x, 'y, 'v) )
.read.
toMatrix[Int,Int,Double]('x,'y,'v)
(a0 * a0 * a0 * a0 * a0 * a0 * a0 * a0).write( Tsv("/home/ttauber/scalding-bench/aold.tsv"))
@tomtau
tomtau / Graph propagation (common subtrees)
Created September 5, 2013 15:02
Generated job using the new Matrix API
import com.twitter.scalding._
import cascading.pipe.joiner._
import com.twitter.scalding.mathematics.Matrix2
import com.twitter.scalding.mathematics.FiniteHint
import com.twitter.algebird.Group
class BenchNewJob(args : Args) extends Job(args) {
import Matrix2._
import com.twitter.scalding.mathematics.MatrixLiteral
@tomtau
tomtau / Sums in one groupBy
Created September 5, 2013 15:03
Generated job using the old Matrix API
import com.twitter.scalding._
import com.twitter.scalding.mathematics.Matrix
class BenchOldJob(args : Args) extends Job(args) {
import Matrix._
val a0 = Tsv("/home/ttauber/scalding-bench/a0.tsv", ('x, 'y, 'v) )
.read.
toMatrix[Int,Int,Double]('x,'y,'v)
@tomtau
tomtau / Sums in one groupBy
Created September 5, 2013 15:04
Generated job using the new Matrix API
import com.twitter.scalding._
import cascading.pipe.joiner._
import com.twitter.scalding.mathematics.Matrix2
import com.twitter.scalding.mathematics.FiniteHint
import com.twitter.algebird.Group
class BenchNewJob(args : Args) extends Job(args) {
import Matrix2._
import com.twitter.scalding.mathematics.MatrixLiteral
@tomtau
tomtau / TSV Matrix and Job Generator
Created September 5, 2013 15:11
Quick and dirty script for generating jobs in the old and new Matrix API as well as corresponding TSV
package tsvgen
import java.io._
import scala.util.Random
object TsvGenerator {
def generateTsv(matrixParam: (String, Long, Long)): Unit = {
val (filename, rows, cols) = matrixParam
val writer = new PrintWriter(new File(filename))
@tomtau
tomtau / Optimization or Untyped Pipe overhead
Created September 5, 2013 15:18
Generated job using the old Matrix API
import com.twitter.scalding._
import com.twitter.scalding.mathematics.Matrix
class BenchOldJob(args : Args) extends Job(args) {
import Matrix._
val a0 = Tsv("/home/ttauber/scalding-bench/a0.tsv", ('x, 'y, 'v) )
.read.
toMatrix[Int,Int,Double]('x,'y,'v)
@tomtau
tomtau / Optimization or Untyped Pipe overhead
Created September 5, 2013 15:19
Generated job using the new Matrix API
import com.twitter.scalding._
import cascading.pipe.joiner._
import com.twitter.scalding.mathematics.Matrix2
import com.twitter.scalding.mathematics.FiniteHint
import com.twitter.algebird.Group
class BenchNewJob(args : Args) extends Job(args) {
import Matrix2._
import com.twitter.scalding.mathematics.MatrixLiteral
@tomtau
tomtau / Matrix chain multiplication
Created September 5, 2013 15:21
Generated job using the old Matrix API
import com.twitter.scalding._
import com.twitter.scalding.mathematics.Matrix
class BenchOldJob(args : Args) extends Job(args) {
import Matrix._
val a0 = Tsv("/home/ttauber/scalding-bench/a0.tsv", ('x, 'y, 'v) )
.read.
toMatrix[Int,Int,Double]('x,'y,'v)