Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-5115 Fix for performance issues with ShaclSail after fix for compressed validation tuples #5119

Merged

Conversation

hmottestad
Copy link
Contributor

@hmottestad hmottestad commented Aug 29, 2024

GitHub issue resolved: #5115

Briefly describe the changes proposed in this PR:


PR Author Checklist (see the contributor guidelines for more details):

  • my pull request is self-contained
  • I've added tests for the changes I made
  • I've applied code formatting (you can use mvn process-resources to format from the command line)
  • I've squashed my commits where necessary
  • every commit message starts with the issue number (GH-xxxx) followed by a meaningful description of the change

Before

Benchmark                                                          Mode  Cnt     Score     Error  Units
ComplexLargeBenchmark.disabledValidationSail                       avgt    5   358.824 ±  38.191  ms/op
ComplexLargeBenchmark.disabledValidationTransaction                avgt    5   356.420 ±  27.879  ms/op
ComplexLargeBenchmark.noPreloading                                 avgt    5   678.464 ±  98.324  ms/op
ComplexLargeBenchmark.noPreloadingBulk                             avgt    5   652.532 ±  14.735  ms/op
ComplexLargeBenchmark.noPreloadingBulkParallelCached               avgt    5   558.096 ±  54.905  ms/op
ComplexLargeBenchmark.noPreloadingNonEmpty                         avgt    5  2984.330 ±  85.934  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallel                 avgt    5  2129.350 ±  35.701  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallelLmdb             avgt    5  8165.658 ± 271.752  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallelNativeStore      avgt    5  6998.737 ± 377.024  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallelReadCommitted    avgt    5  3838.380 ± 139.557  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallelRemoved          avgt    5  2273.318 ± 202.531  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyRemoved                  avgt    5  3369.851 ± 521.790  ms/op
ComplexLargeBenchmark.noPreloadingParallel                         avgt    5   722.336 ±  65.782  ms/op
ComplexLargeBenchmark.noPreloadingParallelNoCache                  avgt    5   655.416 ± 130.262  ms/op
ComplexLargeBenchmark.noPreloadingRevalidate                       avgt    5   562.064 ±  17.714  ms/op
ComplexLargeBenchmark.noPreloadingRevalidateLowMem                 avgt    5   627.493 ±  17.177  ms/op
ComplexLargeBenchmark.noPreloadingRevalidateNativeStore            avgt    5  3335.937 ± 101.412  ms/op
ComplexLargeBenchmark.noPreloadingTransactionalValidationLimit     avgt    5   998.597 ±  91.490  ms/op
ComplexLargeBenchmark.shaclNothingToValidateTransactionsPreloaded  avgt    5     0.102 ±   0.004  ms/op
Benchmark                      Mode  Cnt   Score   Error  Units
ClassBenchmarkEmpty.shacl      avgt    5  12.559 ± 1.634  ms/op
ClassBenchmarkEmpty.shaclBulk  avgt    5  15.680 ± 1.495  ms/op
digraph G {
	rank1 [style=invisible];
	rank2 [style=invisible];
	
	rank1 -> rank2 [color=white];
	{
		rank = same;
		rank2 -> 2038105753 -> 88397182 -> 1438988851 [ style=invis ];
		rankdir = LR;
	}
	2038105753 [label="BaseConnection" fillcolor="#CACADB", style=filled];
	88397182 [label="AddedStatements" fillcolor="#CEDBCA", style=filled];
	1438988851 [label="RemovedStatements" fillcolor="#DBCFC9r", style=filled];
	1513608173 [label="Unique{compress=true}"];
	652176954 -> 1513608173
	652176954 [label="Sort"];
	1245065720 -> 652176954
	1245065720 [label="ShiftToNodeShape"];
	1800976873 -> 1245065720
	1800976873 [label="ValidationReportNode"];
	253011924 -> 1800976873
	253011924 [label="ExternalPredicateObjectFilter{filterOnObject=foaf:Person, filterOnPredicate=rdf:type, filterOn=value, returnMatching=false}"];
	1390913202 -> 253011924
	2038105753 -> 253011924 [label="filter source"]
	1390913202 [label="ExternalPredicateObjectFilter{filterOnObject=foaf:Person, filterOnPredicate=rdf:type, filterOn=value, returnMatching=false}"];
	698741991 -> 1390913202
	88397182 -> 1390913202 [label="filter source"]
	698741991 [label="BulkedExternalInnerJoin{query=?a <http://xmlns.com/foaf/0.1/knows> ?c .}"];
	127702987 -> 698741991 [label="left"]
	2038105753 -> 698741991 [label="right"]
	127702987 [label="Unique{compress=false}"];
	765242091 -> 127702987
	765242091 [label="UnionNode"];
	1117871068 -> 765242091
	1117871068 [label="BufferedSplitter (cached)"];
	1151704483 -> 1117871068
	1151704483 [label="Sort"];
	669284403 -> 1151704483
	669284403 [label="UnionNode"];
	1869039062 -> 669284403
	1869039062 [label="ExternalPredicateObjectFilter{filterOnObject=foaf:Person, filterOnPredicate=rdf:type, filterOn=activeTarget, returnMatching=true}"];
	659590237 -> 1869039062
	88397182 -> 1869039062 [label="filter source"]
	659590237 [label="BufferedSplitter (cached)"];
	1332757905 -> 659590237
	1332757905 [label="Unique{compress=false}"];
	1263634860 -> 1332757905
	1263634860 [label="ModifyValidationTuple"];
	508378341 -> 1263634860
	508378341 [label="ReduceTargets"];
	1037854997 -> 508378341
	1884155890 -> 508378341
	1037854997 [label="Sort"];
	932582590 -> 1037854997
	932582590 [label="UnionNode"];
	1078705341 -> 932582590
	1078705341 [label="ExternalPredicateObjectFilter{filterOnObject=foaf:Person, filterOnPredicate=rdf:type, filterOn=activeTarget, returnMatching=true}"];
	511832416 -> 1078705341
	88397182 -> 1078705341 [label="filter source"]
	511832416 [label="BufferedSplitter (cached)"];
	28094269 -> 511832416
	28094269 [label="Unique{compress=false}"];
	110651474 -> 28094269
	110651474 [label="Sort"];
	464224872 -> 110651474
	464224872 [label="TrimToTarget{keepPath=false}"];
	170949260 -> 464224872
	170949260 [label="UnorderedSelect{subject=null, predicate=foaf:knows, object=null}"];
	88397182 -> 170949260
	1845623216 -> 932582590
	1845623216 [label="ExternalPredicateObjectFilter{filterOnObject=foaf:Person, filterOnPredicate=rdf:type, filterOn=activeTarget, returnMatching=true}"];
	731829978 -> 1845623216
	2038105753 -> 1845623216 [label="filter source"]
	731829978 [label="ExternalPredicateObjectFilter{filterOnObject=foaf:Person, filterOnPredicate=rdf:type, filterOn=activeTarget, returnMatching=false}"];
	511832416 -> 731829978
	88397182 -> 731829978 [label="filter source"]
	1884155890 [label="BufferedSplitter (cached)"];
	1818339587 -> 1884155890
	1818339587 [label="Unique{compress=false}"];
	1703696921 -> 1818339587
	1703696921 [label="Sort"];
	69329761 -> 1703696921
	69329761 [label="UnorderedSelect{subject=null, predicate=rdf:type, object=foaf:Person}"];
	88397182 -> 69329761
	1507118393 -> 669284403
	1507118393 [label="ExternalPredicateObjectFilter{filterOnObject=foaf:Person, filterOnPredicate=rdf:type, filterOn=activeTarget, returnMatching=true}"];
	949767857 -> 1507118393
	2038105753 -> 1507118393 [label="filter source"]
	949767857 [label="ExternalPredicateObjectFilter{filterOnObject=foaf:Person, filterOnPredicate=rdf:type, filterOn=activeTarget, returnMatching=false}"];
	659590237 -> 949767857
	88397182 -> 949767857 [label="filter source"]
	1884155890 -> 765242091
}

graphviz-2

@hmottestad
Copy link
Contributor Author

hmottestad commented Aug 29, 2024

Benchmark                                                          Mode  Cnt     Score     Error  Units
ComplexLargeBenchmark.disabledValidationSail                       avgt    5   324.551 ±  12.276  ms/op
ComplexLargeBenchmark.disabledValidationTransaction                avgt    5   329.150 ±   2.549  ms/op
ComplexLargeBenchmark.noPreloading                                 avgt    5   639.395 ±  15.819  ms/op
ComplexLargeBenchmark.noPreloadingBulk                             avgt    5   621.292 ±  10.039  ms/op
ComplexLargeBenchmark.noPreloadingBulkParallelCached               avgt    5   565.250 ±   7.821  ms/op
ComplexLargeBenchmark.noPreloadingNonEmpty                         avgt    5  3480.632 ± 169.819  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallel                 avgt    5  2286.126 ±  79.121  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallelLmdb             avgt    5  8897.433 ±  81.425  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallelNativeStore      avgt    5  7470.019 ± 234.935  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallelReadCommitted    avgt    5  3915.661 ±  89.769  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallelRemoved          avgt    5  2462.966 ± 153.642  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyRemoved                  avgt    5  3996.005 ± 328.526  ms/op
ComplexLargeBenchmark.noPreloadingParallel                         avgt    5   681.439 ± 155.363  ms/op
ComplexLargeBenchmark.noPreloadingParallelNoCache                  avgt    5   652.911 ±  64.777  ms/op
ComplexLargeBenchmark.noPreloadingRevalidate                       avgt    5   633.731 ±  66.420  ms/op
ComplexLargeBenchmark.noPreloadingRevalidateLowMem                 avgt    5   750.487 ± 106.113  ms/op
ComplexLargeBenchmark.noPreloadingRevalidateNativeStore            avgt    5  3646.007 ± 211.208  ms/op
ComplexLargeBenchmark.noPreloadingTransactionalValidationLimit     avgt    5   970.565 ±  57.859  ms/op
ComplexLargeBenchmark.shaclNothingToValidateTransactionsPreloaded  avgt    5     0.111 ±   0.008  ms/op
Benchmark                      Mode  Cnt   Score   Error  Units
ClassBenchmarkEmpty.shacl      avgt    5  14.793 ± 1.036  ms/op
ClassBenchmarkEmpty.shaclBulk  avgt    5  14.344 ± 1.065  ms/op

graphviz-3

@hmottestad hmottestad closed this Aug 29, 2024
@hmottestad hmottestad reopened this Aug 29, 2024
@hmottestad
Copy link
Contributor Author

Benchmark                                                          Mode  Cnt     Score     Error  Units
ComplexLargeBenchmark.disabledValidationSail                       avgt    5   350.458 ±  27.187  ms/op
ComplexLargeBenchmark.disabledValidationTransaction                avgt    5   334.068 ±  17.686  ms/op
ComplexLargeBenchmark.noPreloading                                 avgt    5   735.559 ± 225.508  ms/op
ComplexLargeBenchmark.noPreloadingBulk                             avgt    5   654.946 ±  36.367  ms/op
ComplexLargeBenchmark.noPreloadingBulkParallelCached               avgt    5   605.351 ±  17.368  ms/op
ComplexLargeBenchmark.noPreloadingNonEmpty                         avgt    5  3301.090 ± 911.685  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallel                 avgt    5  2109.469 ± 101.001  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallelLmdb             avgt    5  8194.144 ± 189.139  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallelNativeStore      avgt    5  7178.048 ± 256.438  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallelReadCommitted    avgt    5  3857.976 ± 188.139  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallelRemoved          avgt    5  2263.481 ±  20.183  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyRemoved                  avgt    5  3517.926 ± 336.596  ms/op
ComplexLargeBenchmark.noPreloadingParallel                         avgt    5   618.813 ±  21.436  ms/op
ComplexLargeBenchmark.noPreloadingParallelNoCache                  avgt    5   639.426 ±  57.406  ms/op
ComplexLargeBenchmark.noPreloadingRevalidate                       avgt    5   554.490 ±  13.520  ms/op
ComplexLargeBenchmark.noPreloadingRevalidateLowMem                 avgt    5   619.776 ± 116.622  ms/op
ComplexLargeBenchmark.noPreloadingRevalidateNativeStore            avgt    5  3353.978 ±  54.369  ms/op
ComplexLargeBenchmark.noPreloadingTransactionalValidationLimit     avgt    5   953.040 ±  16.357  ms/op
ComplexLargeBenchmark.shaclNothingToValidateTransactionsPreloaded  avgt    5     0.109 ±   0.003  ms/op

@hmottestad hmottestad marked this pull request as ready for review September 18, 2024 08:00
@hmottestad hmottestad merged commit 89c9579 into main Sep 18, 2024
9 checks passed
@hmottestad hmottestad deleted the GH-5115-fix-performance-issues-with-previous-solution branch September 18, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SHACL - bug where sh:class could cause missing validation results when nested sh:property and sh:node
1 participant