Skip to content

Instantly share code, notes, and snippets.

@krsna1729
Last active April 20, 2021 07:25
Show Gist options
  • Save krsna1729/47e9213f264b975249d4d74259a9e43e to your computer and use it in GitHub Desktop.
Save krsna1729/47e9213f264b975249d4d74259a9e43e to your computer and use it in GitHub Desktop.
compute universal scalability law USL co-efficient and plot
library(usl)
mpps.128 <- data.frame(workers=c(1,2,4,8,16), mpps=c(2.21,4.06,7.68,13.93,22.28))
mpps.256 <- data.frame(workers=c(1,2,4,8,16), mpps=c(2.13,3.83,7.03,12.04,19.80))
mpps.512 <- data.frame(workers=c(1,2,4,8,16), mpps=c(2.05,3.52,6.03,10.49,17.55))
mpps.1024 <- data.frame(workers=c(1,2,4,8,16), mpps=c(1.78,2.84,4.90,8.40,9.87))
plot(ylim=c(0,30), xlim=c(0,32), mpps ~ workers, data = mpps.128, col = "blue", pch = "o", type = "o", lty=1)
points(mpps.256$workers, mpps.256$mpps, col = "green", pch = "*")
points(mpps.512$workers, mpps.512$mpps, col = "red", pch = "+")
points(mpps.1024$workers, mpps.1024$mpps, col = "black", pch = "^")
lines(mpps.256$workers, mpps.256$mpps, col = "green", pch = "*", lty=2)
lines(mpps.512$workers, mpps.512$mpps, col = "red", pch = "+", lty=3)
lines(mpps.1024$workers, mpps.1024$mpps, col = "black", pch = "^", lty=4)
usl.model.128 <- usl(mpps ~ workers, mpps.128)
usl.model.256 <- usl(mpps ~ workers, mpps.256)
usl.model.512 <- usl(mpps ~ workers, mpps.512)
usl.model.1024 <- usl(mpps ~ workers, mpps.1024)
summary(usl.model.128)
summary(usl.model.256)
summary(usl.model.512)
summary(usl.model.1024)
plot(mpps ~ workers, data = mpps.128, pch = "o", xlim = c(0, 48), ylim = c(0, 100), main = "128 B")
plot(usl.model.128, add = TRUE, bounds = TRUE)
plot(mpps ~ workers, data = mpps.256, pch = "*", xlim = c(0, 48), ylim = c(0, 100), main = "256 B")
plot(usl.model.256, add = TRUE, bounds = TRUE)
plot(mpps ~ workers, data = mpps.512, pch = "+", xlim = c(0, 48), ylim = c(0, 100), main = "512 B")
plot(usl.model.512, add = TRUE, bounds = TRUE)
plot(mpps ~ workers, data = mpps.1024, pch = "^", xlim = c(0, 48), ylim = c(0, 100), main = "1024 B")
plot(usl.model.1024, add = TRUE, bounds = TRUE)
mbps.128 <- data.frame(workers=c(1,2,4,8,16), mbps=c(2788.86,5134.26,9703.35,17590.88,28144.07))
mbps.256 <- data.frame(workers=c(1,2,4,8,16), mbps=c(4873.25,8750.56,16091.09,27544.34,45295.80))
mbps.512 <- data.frame(workers=c(1,2,4,8,16), mbps=c(8873.14,15241.29,26148.98,45501.19,76087.11))
mbps.1024 <- data.frame(workers=c(1,2,4,8,16), mbps=c(15037.51,23977.56,41270.82,70847.06,83168.52))
plot(ylim=c(0,100000), xlim=c(0,32), mbps ~ workers, data = mbps.128, col = "blue", pch = "o", type = "o", lty=1)
points(mbps.256$workers, mbps.256$mbps, col = "green", pch = "*")
points(mbps.512$workers, mbps.512$mbps, col = "red", pch = "+")
points(mbps.1024$workers, mbps.1024$mbps, col = "black", pch = "^")
lines(mbps.256$workers, mbps.256$mbps, col = "green", pch = "*", lty=2)
lines(mbps.512$workers, mbps.512$mbps, col = "red", pch = "+", lty=3)
lines(mbps.1024$workers, mbps.1024$mbps, col = "black", pch = "^", lty=4)
usl.model.128 <- usl(mbps ~ workers, mbps.128)
usl.model.256 <- usl(mbps ~ workers, mbps.256)
usl.model.512 <- usl(mbps ~ workers, mbps.512)
usl.model.1024 <- usl(mbps ~ workers, mbps.1024)
summary(usl.model.128)
summary(usl.model.256)
summary(usl.model.512)
summary(usl.model.1024)
plot(mbps ~ workers, data = mbps.128, pch = "o", xlim = c(0, 48), ylim = c(0, 100000), main = "128 B")
plot(usl.model.128, add = TRUE, bounds = TRUE)
plot(mbps ~ workers, data = mbps.256, pch = "*", xlim = c(0, 48), ylim = c(0, 100000), main = "256 B")
plot(usl.model.256, add = TRUE, bounds = TRUE)
plot(mbps ~ workers, data = mbps.512, pch = "+", xlim = c(0, 48), ylim = c(0, 100000), main = "512 B")
plot(usl.model.512, add = TRUE, bounds = TRUE)
plot(mbps ~ workers, data = mbps.1024, pch = "^", xlim = c(0, 48), ylim = c(0, 100000), main = "1024 B")
plot(usl.model.1024, add = TRUE, bounds = TRUE)
library(usl)
mpps.128 <- data.frame(workers=c(1,2,4,8,16), mpps=c(2.24,4.24,8.03,15.43,26.58))
mpps.256 <- data.frame(workers=c(1,2,4,8,16), mpps=c(2.18,4.04,7.73,14.93,25.73))
mpps.512 <- data.frame(workers=c(1,2,4,8,16), mpps=c(2.10,3.90,7.44,14.45,21.31))
mpps.1024 <- data.frame(workers=c(1,2,4,8,16), mpps=c(1.96,3.68,6.93,11.35,10.48))
plot(ylim=c(0,30), xlim=c(0,32), mpps ~ workers, data = mpps.128, col = "blue", pch = "o", type = "o", lty=1)
points(mpps.256$workers, mpps.256$mpps, col = "green", pch = "*")
points(mpps.512$workers, mpps.512$mpps, col = "red", pch = "+")
points(mpps.1024$workers, mpps.1024$mpps, col = "black", pch = "^")
lines(mpps.256$workers, mpps.256$mpps, col = "green", pch = "*", lty=2)
lines(mpps.512$workers, mpps.512$mpps, col = "red", pch = "+", lty=3)
lines(mpps.1024$workers, mpps.1024$mpps, col = "black", pch = "^", lty=4)
usl.model.128 <- usl(mpps ~ workers, mpps.128)
usl.model.256 <- usl(mpps ~ workers, mpps.256)
usl.model.512 <- usl(mpps ~ workers, mpps.512)
usl.model.1024 <- usl(mpps ~ workers, mpps.1024)
summary(usl.model.128)
summary(usl.model.256)
summary(usl.model.512)
summary(usl.model.1024)
plot(mpps ~ workers, data = mpps.128, pch = "o", xlim = c(0, 48), ylim = c(0, 100), main = "128 B")
plot(usl.model.128, add = TRUE, bounds = TRUE)
plot(mpps ~ workers, data = mpps.256, pch = "*", xlim = c(0, 48), ylim = c(0, 100), main = "256 B")
plot(usl.model.256, add = TRUE, bounds = TRUE)
plot(mpps ~ workers, data = mpps.512, pch = "+", xlim = c(0, 48), ylim = c(0, 100), main = "512 B")
plot(usl.model.512, add = TRUE, bounds = TRUE)
plot(mpps ~ workers, data = mpps.1024, pch = "^", xlim = c(0, 48), ylim = c(0, 100), main = "1024 B")
plot(usl.model.1024, add = TRUE, bounds = TRUE)
mbps.128 <- data.frame(workers=c(1,2,4,8,16), mbps=c(2834.33,5353.22,10147.21,19485.33,33570.99))
mbps.256 <- data.frame(workers=c(1,2,4,8,16), mbps=c(4975.74,9233.96,17673.48,34160.37,58880.45))
mbps.512 <- data.frame(workers=c(1,2,4,8,16), mbps=c(9111.86,16893.93,32238.08,62674.45,92402.07))
mbps.1024 <- data.frame(workers=c(1,2,4,8,16), mbps=c(16563.52,31022.27,58412.11,95684.80,88328.19))
plot(ylim=c(0,100000), xlim=c(0,32), mbps ~ workers, data = mbps.128, col = "blue", pch = "o", type = "o", lty=1)
points(mbps.256$workers, mbps.256$mbps, col = "green", pch = "*")
points(mbps.512$workers, mbps.512$mbps, col = "red", pch = "+")
points(mbps.1024$workers, mbps.1024$mbps, col = "black", pch = "^")
lines(mbps.256$workers, mbps.256$mbps, col = "green", pch = "*", lty=2)
lines(mbps.512$workers, mbps.512$mbps, col = "red", pch = "+", lty=3)
lines(mbps.1024$workers, mbps.1024$mbps, col = "black", pch = "^", lty=4)
usl.model.128 <- usl(mbps ~ workers, mbps.128)
usl.model.256 <- usl(mbps ~ workers, mbps.256)
usl.model.512 <- usl(mbps ~ workers, mbps.512)
usl.model.1024 <- usl(mbps ~ workers, mbps.1024)
summary(usl.model.128)
summary(usl.model.256)
summary(usl.model.512)
summary(usl.model.1024)
plot(mbps ~ workers, data = mbps.128, pch = "o", xlim = c(0, 48), ylim = c(0, 100000), main = "128 B")
plot(usl.model.128, add = TRUE, bounds = TRUE)
plot(mbps ~ workers, data = mbps.256, pch = "*", xlim = c(0, 48), ylim = c(0, 100000), main = "256 B")
plot(usl.model.256, add = TRUE, bounds = TRUE)
plot(mbps ~ workers, data = mbps.512, pch = "+", xlim = c(0, 48), ylim = c(0, 100000), main = "512 B")
plot(usl.model.512, add = TRUE, bounds = TRUE)
plot(mbps ~ workers, data = mbps.1024, pch = "^", xlim = c(0, 48), ylim = c(0, 100000), main = "1024 B")
plot(usl.model.1024, add = TRUE, bounds = TRUE)
@krsna1729
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment