TargetingCollection Performance

The performance test builds random targetings (varying from 10-5000), then queries it with random bids. See the JS file for more details.

# Generate test data
setwd("~/src/incrowd/bidder")
# system('node test/targeting_collection_performance.js')

# Read basic data
basic <- read.csv("targeting_collection.csv")
head(basic)
##   targetings bids time ms.per.bid
## 1         10 1000   96      0.096
## 2         20 1000   78      0.078
## 3         50 1000  100      0.100
## 4        100 1000  132      0.132
## 5        250 1000  242      0.242
## 6        500 1000  411      0.411

# Detailed profiling data:
data <- read.csv("targeting_collection_all.csv")
head(data)
##   targetings bids microtime control found linear
## 1         10 1000       197       5     0    214
## 2         10 1000        64       1     0     74
## 3         10 1000        29       0     0     38
## 4         10 1000        88       1     0     97
## 5         10 1000        30       0     0     39
## 6         10 1000        82       0     0     90
# INVALID NOW Basic performance plot. Looks linear in targetings:# plot(targetings~ms.per.bid, basic)

Performance profile of individual find()'s, with control (variable assignment) for comparison.

library(ggplot2)
library(reshape)
(ggplot(melt(data[, c("targetings", "bids", "microtime", "control")], 
    id = c("targetings", "bids"))) + aes(value, color = factor(targetings)) + 
    geom_density() + scale_x_log10(name = "microseconds", breaks = c(1, 10, 
    100, 200, 500, 1000, 2000, 5000)) + facet_wrap(~variable, nrow = 2) + opts(title = "Latency distribution for different #'s of targetings versus control"))

plot of chunk unnamed-chunk-3

Versus linear:

library(ggplot2)
library(reshape)
(ggplot(melt(data[, c("targetings", "bids", "microtime", "linear")], 
    id = c("targetings", "bids"))) + aes(value, color = factor(targetings)) + 
    geom_density() + scale_x_log10(name = "microseconds", breaks = c(1, 10, 
    100, 200, 500, 1000, 2000, 5000, 10000)) + facet_wrap(~variable, nrow = 2) + 
    opts(title = "Latency distribution for different #'s of targetings versus linear"))

plot of chunk unnamed-chunk-4

Compare mean latency vs linear:

melted <- melt(data[, c("targetings", "bids", "microtime", "linear")], 
    id = c("targetings", "bids"))
aggregated <- aggregate(value ~ targetings + variable, melted, mean)
(ggplot(aggregated) + aes(targetings, value/1000, color = variable) + 
    geom_line() + scale_y_continuous(name = "mean latency (ms)") + scale_x_continuous(name = "number of targetings") + 
    opts(title = "Mean find() latency luis vs linear"))

plot of chunk unnamed-chunk-5

Build time:

setwd("~/src/incrowd/bidder")
data <- read.csv("targeting_collection_build.csv", header = T)
(ggplot(data) + aes(size, time) + geom_point() + geom_smooth(method = lm, 
    fullrange = T) + scale_x_continuous(limits = c(0, 20000)) + scale_y_continuous(limits = c(0, 
    12000)) + opts(title = "TargetingCollection build speed for various random workloads"))

plot of chunk unnamed-chunk-6