Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.apache.accumulo.access.AccessEvaluator;
import org.apache.accumulo.access.AccessExpression;
import org.apache.accumulo.access.Authorizations;
import org.apache.accumulo.access.ParsedAccessExpression;
import org.apache.accumulo.core.security.ColumnVisibility;
import org.apache.accumulo.core.security.VisibilityEvaluator;
import org.apache.accumulo.core.security.VisibilityParseException;
Expand Down Expand Up @@ -163,7 +164,7 @@ List<VisibilityEvaluatorTests> getVisibilityEvaluatorTests() {
}

/**
* Measures the time it takes to parse an expression stored in byte[] and produce a parse tree.
* Measures the time it takes to parse an expression stored in byte[] and validate it.
*/
@Benchmark
public void measureBytesValidation(BenchmarkState state, Blackhole blackhole) {
Expand All @@ -173,7 +174,7 @@ public void measureBytesValidation(BenchmarkState state, Blackhole blackhole) {
}

/**
* Measures the time it takes to parse an expression stored in a String and produce a parse tree.
* Measures the time it takes to parse an expression stored in a String and validate it.
*/
@Benchmark
public void measureStringValidation(BenchmarkState state, Blackhole blackhole) {
Expand All @@ -183,8 +184,18 @@ public void measureStringValidation(BenchmarkState state, Blackhole blackhole) {
}

/**
* Measures the time it takes to parse and evaluate an expression. This has to create the parse
* tree an operate on it.
* Measures the time it takes to parse an expression stored in a String and produce a parse tree.
*
*/
@Benchmark
public void measureCreateParseTree(BenchmarkState state, Blackhole blackhole) {
for (String accessExpression : state.getStringExpressions()) {
blackhole.consume(ParsedAccessExpression.parse(accessExpression));
}
}

/**
* Measures the time it takes to evaluate an expression.
*/
@Benchmark
public void measureParseAndEvaluation(BenchmarkState state, Blackhole blackhole) {
Expand Down