Unrolled example [Two-Stage / GS Designs]
Hi Hötzi,
just tried to implement something that more or less corresponded to the example you had.
I get about a 10% speedup difference if I unroll 4x:
10% isn't bad, actually. One could probably even optimise the number of unrolls.
just tried to implement something that more or less corresponded to the example you had.
I get about a 10% speedup difference if I unroll 4x:
runs <- 1e5
run <- 1:runs
ptm <- proc.time()
i=1
v2 <- vector("numeric", length=runs)
while (i<=runs)
{
v2[i] <- rnorm(1, mean=0, sd=1)
i=i+1
}
t2 <- proc.time()-ptm
cat("Simple time: ", t2[3], "seconds.\n")
#
#
runs <- 1e5
run <- 1:runs
ptm <- proc.time()
i=1
v2 <- vector("numeric", length=runs)
while (i<=runs)
{
v2[i] <- rnorm(1, mean=0, sd=1)
v2[i+1] <- rnorm(1, mean=0, sd=1)
v2[i+2] <- rnorm(1, mean=0, sd=1)
v2[i+3] <- rnorm(1, mean=0, sd=1)
i=i+4
}
t2 <- proc.time()-ptm
cat("Unrolled x4 time: ", t2[3], "seconds.\n")
#
#
10% isn't bad, actually. One could probably even optimise the number of unrolls.
—
Pass or fail!
ElMaestro
Pass or fail!
ElMaestro
Complete thread:
- Gimmick & survey Helmut 2015-02-20 01:47
- Gimmick & survey nobody 2015-02-20 08:25
- Gimmick & survey Helmut 2015-02-20 13:01
- Gimmick & survey nobody 2015-02-20 14:18
- Speeed! Helmut 2015-02-20 15:38
- Speeed! nobody 2015-02-20 16:37
- Speeed! ElMaestro 2015-02-20 23:48
- Speeed! Helmut 2015-02-21 01:11
- Unrolled exampleElMaestro 2015-02-21 01:32
- Unrolled example Helmut 2015-02-21 01:50
- Unrolled example ElMaestro 2015-02-21 02:27
- Increasing vector & another example Helmut 2015-02-21 13:13
- Unrolled example ElMaestro 2015-02-21 02:27
- Unrolled example Helmut 2015-02-21 01:50
- Speeed! nobody 2015-02-21 21:02
- Unrolled exampleElMaestro 2015-02-21 01:32
- Speeed! Helmut 2015-02-21 01:11
- Speeed! Helmut 2015-02-20 15:38
- Gimmick & survey nobody 2015-02-20 14:18
- Gimmick & survey Helmut 2015-02-20 13:01
- Gimmick & survey nobody 2015-02-20 08:25