Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ jobs:
- name: Start up test databases
run: docker compose up --force-recreate -d --wait --quiet-pull

- name: Check headers
- name: Check headers and formatting
if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-22.04'
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' headerCheckAll
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck

- name: scalaJSLink
if: matrix.project == 'rootJS'
Expand Down
2 changes: 1 addition & 1 deletion .jvmopts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-Dsbt.color=always
-Dsbt.supershell=true
-Xms2g
-Xmx4g
-Xmx6g
-Xss4m
-XX:+UseG1GC
84 changes: 84 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
version = 3.11.1

runner.dialect = scala213source3

maxColumn = 96

includeCurlyBraceInSelectChains = true
includeNoParensInSelectChains = true

optIn {
breakChainOnFirstMethodDot = false
forceBlankLineBeforeDocstring = true
}

binPack {
literalArgumentLists = true
parentConstructors = Never
}

danglingParentheses {
defnSite = false
callSite = false
ctrlSite = false

exclude = []
}

newlines {
topLevelStatementBlankLines = [
{ regex = "^Pkg", blanks { after = 1 } }
]
beforeCurlyLambdaParams = multilineWithCaseOnly
afterCurlyLambda = squash
implicitParamListModifierPrefer = before
sometimesBeforeColonInMethodReturnType = true
}

align.preset = none
align.stripMargin = true

assumeStandardLibraryStripMargin = true

docstrings {
style = Asterisk
oneline = unfold
}

project.git = true

trailingCommas = never

rewrite {
rules = [PreferCurlyFors, RedundantParens, Imports]

imports {
sort = scalastyle
selectors = fold
contiguousGroups = no
groups = [
["javax?\\..*"]
["scala\\..*"]
[".*"]
["grackle\\..*"]
["demo\\..*"]
]
}

redundantBraces {
maxLines = 1
stringInterpolation = true
}
}

rewriteTokens {
"⇒": "=>"
"→": "->"
"←": "<-"
}

fileOverride {
"glob:**/scala-3/**" {
runner.dialect = scala3
}
}
21 changes: 11 additions & 10 deletions benchmarks/src/main/scala/ParserBenchmark.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,29 @@

package grackle.benchmarks

import grackle.Schema
import org.openjdk.jmh.annotations._
import org.openjdk.jmh.infra.Blackhole;

import java.util.concurrent.TimeUnit

import scala.io.Source

import org.openjdk.jmh.annotations._
import org.openjdk.jmh.infra.Blackhole

import grackle.Schema

/**
* To do comparative benchmarks between versions:
*
* benchmarks/run-benchmark ParserBenchmark
* benchmarks/run-benchmark ParserBenchmark
*
* This will generate results in `benchmarks/results`.
*
* Or to run the benchmark from within sbt:
*
* jmh:run -i 10 -wi 10 -f 2 -t 1 grackle.benchmarks.ParserBenchmark
* jmh:run -i 10 -wi 10 -f 2 -t 1 grackle.benchmarks.ParserBenchmark
*
* Which means "10 iterations", "10 warm-up iterations", "2 forks", "1 thread".
* Please note that benchmarks should be usually executed at least in
* 10 iterations (as a rule of thumb), but more is better.
* Which means "10 iterations", "10 warm-up iterations", "2 forks", "1 thread". Please note that
* benchmarks should be usually executed at least in 10 iterations (as a rule of thumb), but
* more is better.
*/
@State(Scope.Thread)
@BenchmarkMode(Array(Mode.Throughput))
Expand All @@ -56,4 +58,3 @@ class ParserBenchmark {
}

}

Loading
Loading