Skip to content

Commit 9b04956

Browse files
committed
Release 0.5.11.
Signed-off-by: Simeon H.K. Fitch <[email protected]>
1 parent 478783e commit 9b04956

File tree

23 files changed

+2648
-149
lines changed

23 files changed

+2648
-149
lines changed

bench/archive/jmh-results-20171130120731.json

Lines changed: 444 additions & 0 deletions
Large diffs are not rendered by default.

bench/archive/jmh-results-20171130135353.json

Lines changed: 652 additions & 0 deletions
Large diffs are not rendered by default.

bench/archive/jmh-results-20171130145409.json

Lines changed: 452 additions & 0 deletions
Large diffs are not rendered by default.

bench/archive/jmh-results-20171201123901.json

Lines changed: 452 additions & 0 deletions
Large diffs are not rendered by default.

bench/build.sbt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
enablePlugins(BenchmarkPlugin)
22

3+
libraryDependencies ++= Seq(
4+
spark("core"),
5+
spark("sql"),
6+
geotrellis("spark"),
7+
geotrellis("raster")
8+
)
9+
310
jmhIterations := Some(5)
411
jmhTimeUnit := None
512
javaOptions in Jmh := Seq("-Xmx4g")
613

714
// To enable profiling:
815
// jmhExtraOptions := Some("-prof jmh.extras.JFR")
16+
// jmhExtraOptions := Some("-prof gc")
917

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
* This software is licensed under the Apache 2 license, quoted below.
3+
*
4+
* Copyright 2017 Astraea, Inc.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
7+
* use this file except in compliance with the License. You may obtain a copy of
8+
* the License at
9+
*
10+
* [http://www.apache.org/licenses/LICENSE-2.0]
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15+
* License for the specific language governing permissions and limitations under
16+
* the License.
17+
*
18+
*/
19+
20+
package astraea.spark.rasterframes.bench
21+
22+
import java.util.concurrent.TimeUnit
23+
24+
import geotrellis.raster.Tile
25+
import org.apache.spark.sql.catalyst.InternalRow
26+
import org.apache.spark.sql.catalyst.encoders.ExpressionEncoder
27+
import org.apache.spark.sql.gt.InternalRowTile
28+
import org.apache.spark.sql.gt.types.TileUDT
29+
import org.openjdk.jmh.annotations._
30+
31+
@BenchmarkMode(Array(Mode.AverageTime))
32+
@State(Scope.Benchmark)
33+
@OutputTimeUnit(TimeUnit.MICROSECONDS)
34+
/**
35+
* @author sfitch
36+
* @since 9/29/17
37+
*/
38+
class TileCellScanBench extends SparkEnv {
39+
40+
@Param(Array("uint8", "int32", "float32", "float64"))
41+
var cellTypeName: String = _
42+
43+
@Param(Array("512"))
44+
var tileSize: Int = _
45+
46+
@transient
47+
var tileRow: InternalRow = _
48+
49+
@Setup(Level.Trial)
50+
def setupData(): Unit = {
51+
tileRow = TileUDT.serialize(randomTile(tileSize, tileSize, cellTypeName))
52+
}
53+
54+
@Benchmark
55+
def deserializeRead(): Double = {
56+
val tile = TileUDT.deserialize(tileRow)
57+
val (cols, rows) = tile.dimensions
58+
tile.getDouble(cols - 1, rows - 1) +
59+
tile.getDouble(cols/2, rows/2) +
60+
tile.getDouble(0, 0)
61+
}
62+
63+
@Benchmark
64+
def internalRowRead(): Double = {
65+
val tile = new InternalRowTile(tileRow)
66+
val cols = tile.cols
67+
val rows = tile.rows
68+
tile.getDouble(cols - 1, rows - 1) +
69+
tile.getDouble(cols/2, rows/2) +
70+
tile.getDouble(0, 0)
71+
}
72+
}
73+
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* This software is licensed under the Apache 2 license, quoted below.
3+
*
4+
* Copyright 2017 Astraea, Inc.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
7+
* use this file except in compliance with the License. You may obtain a copy of
8+
* the License at
9+
*
10+
* [http://www.apache.org/licenses/LICENSE-2.0]
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15+
* License for the specific language governing permissions and limitations under
16+
* the License.
17+
*
18+
*/
19+
package astraea.spark.rasterframes.bench
20+
21+
import java.util.concurrent.TimeUnit
22+
23+
import astraea.spark.rasterframes._
24+
import org.apache.spark.sql._
25+
import org.apache.spark.sql.functions._
26+
import org.openjdk.jmh.annotations._
27+
28+
/**
29+
*
30+
* @author sfitch
31+
* @since 10/4/17
32+
*/
33+
@BenchmarkMode(Array(Mode.AverageTime))
34+
@State(Scope.Benchmark)
35+
@OutputTimeUnit(TimeUnit.MILLISECONDS)
36+
class TileExplodeBench extends SparkEnv {
37+
import spark.implicits._
38+
39+
@Param(Array("uint8", "uint16ud255", "float32", "float64"))
40+
var cellTypeName: String = _
41+
42+
@Param(Array("256"))
43+
var tileSize: Int = _
44+
45+
@Param(Array("100"))
46+
var numTiles: Int = _
47+
48+
@transient
49+
var tiles: DataFrame = _
50+
51+
@Setup(Level.Trial)
52+
def setupData(): Unit = {
53+
tiles = Seq.fill(numTiles)(randomTile(tileSize, tileSize, cellTypeName))
54+
.toDF("tile").repartition(10)
55+
}
56+
57+
@Benchmark
58+
def arrayExplode() = {
59+
tiles.select(posexplode(tileToArray[Double]($"tile"))).count()
60+
}
61+
62+
@Benchmark
63+
def tileExplode() = {
64+
tiles.select(explodeTiles($"tile")).count()
65+
}
66+
}

project/ProjectPlugin.scala

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ object ProjectPlugin extends AutoPlugin {
2626
"spark" -> "2.1.0"
2727
)
2828

29-
private def geotrellis(module: String) =
30-
"org.locationtech.geotrellis" %% s"geotrellis-$module" % versions("geotrellis")
31-
private def spark(module: String) =
32-
"org.apache.spark" %% s"spark-$module" % versions("spark")
29+
import autoImport._
3330

3431
override def projectSettings = Seq(
3532
organization := "io.astraea",
@@ -79,6 +76,12 @@ object ProjectPlugin extends AutoPlugin {
7976
)
8077

8178
object autoImport {
79+
80+
def geotrellis(module: String) =
81+
"org.locationtech.geotrellis" %% s"geotrellis-$module" % versions("geotrellis")
82+
def spark(module: String) =
83+
"org.apache.spark" %% s"spark-$module" % versions("spark")
84+
8285
def releaseSettings: Seq[Def.Setting[_]] = {
8386
val buildSite: (State) State = releaseStepTask(makeSite)
8487
val publishSite: (State) State = releaseStepTask(ghpagesPushSite)
@@ -124,9 +127,9 @@ object ProjectPlugin extends AutoPlugin {
124127
apiURL := Some(url("http://rasterframes.io/latest/api")),
125128
autoAPIMappings := false,
126129
paradoxProperties in Paradox ++= Map(
127-
"github.base_url" -> "https://github.com/s22s/raster-frames"//,
128-
//"scaladoc.org.apache.spark.sql.gt" -> "http://rasterframes.io/latest" //,
129-
//"scaladoc.geotrellis.base_url" -> "https://geotrellis.github.io/scaladocs/latest"
130+
"github.base_url" -> "https://github.com/s22s/raster-frames",
131+
"scaladoc.org.apache.spark.sql.gt" -> "http://rasterframes.io/latest",
132+
"scaladoc.geotrellis.base_url" -> "https://geotrellis.github.io/scaladocs/latest"
130133
),
131134
sourceDirectory in Paradox := tutTargetDirectory.value,
132135
sourceDirectory in Paradox in paradoxTheme := sourceDirectory.value / "main" / "paradox" / "_template",

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.0.2
1+
sbt.version=1.0.4

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ addSbtPlugin("de.heikoseeberger" % "sbt-header" % "3.0.2")
1010

1111
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.10")
1212

13-
addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.6.0")
13+
addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.6.2")
1414

1515
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.1")
1616

0 commit comments

Comments
 (0)