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-5112 various bugs related to the ShaclSail #5117

Merged
merged 6 commits into from
Aug 27, 2024
Merged

Conversation

hmottestad
Copy link
Contributor

@hmottestad hmottestad commented Aug 27, 2024

GitHub issue resolved: #5112 #5113 #5114 #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

@hmottestad hmottestad marked this pull request as ready for review August 27, 2024 09:17
@hmottestad hmottestad merged commit 5c956e1 into main Aug 27, 2024
9 checks passed
@hmottestad hmottestad deleted the GH-5112-various-bugs branch August 27, 2024 09:50
@hmottestad
Copy link
Contributor Author

hmottestad commented Aug 27, 2024

Before

Benchmark                                  Mode  Cnt   Score   Error  Units
SparqlConstraintsBenchmarkEmpty.shacl      avgt    5  43.552 ± 3.038  ms/op
SparqlConstraintsBenchmarkEmpty.shaclBulk  avgt    5  22.324 ± 2.957  ms/op
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

After

Benchmark                                  Mode  Cnt   Score   Error  Units
SparqlConstraintsBenchmarkEmpty.shacl      avgt    5  42.473 ± 4.833  ms/op
SparqlConstraintsBenchmarkEmpty.shaclBulk  avgt    5  20.516 ± 2.267  ms/op
Benchmark                                                          Mode  Cnt     Score      Error  Units
ComplexLargeBenchmark.disabledValidationSail                       avgt    5   332.216 ±   54.691  ms/op
ComplexLargeBenchmark.disabledValidationTransaction                avgt    5   329.656 ±   13.421  ms/op
ComplexLargeBenchmark.noPreloading                                 avgt    5   652.694 ±   61.175  ms/op
ComplexLargeBenchmark.noPreloadingBulk                             avgt    5   631.931 ±   28.237  ms/op
ComplexLargeBenchmark.noPreloadingBulkParallelCached               avgt    5   583.691 ±   68.283  ms/op
ComplexLargeBenchmark.noPreloadingNonEmpty                         avgt    5  3751.262 ±  182.784  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallel                 avgt    5  2469.678 ±  302.404  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallelLmdb             avgt    5  9497.425 ± 1303.038  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallelNativeStore      avgt    5  7256.163 ±  365.693  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallelReadCommitted    avgt    5  4295.821 ±  431.832  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyParallelRemoved          avgt    5  2755.962 ±  538.590  ms/op
ComplexLargeBenchmark.noPreloadingNonEmptyRemoved                  avgt    5  3915.580 ±  193.414  ms/op
ComplexLargeBenchmark.noPreloadingParallel                         avgt    5   677.575 ±  129.554  ms/op
ComplexLargeBenchmark.noPreloadingParallelNoCache                  avgt    5   644.252 ±   45.313  ms/op
ComplexLargeBenchmark.noPreloadingRevalidate                       avgt    5   568.130 ±   29.726  ms/op
ComplexLargeBenchmark.noPreloadingRevalidateLowMem                 avgt    5   642.213 ±   35.515  ms/op
ComplexLargeBenchmark.noPreloadingRevalidateNativeStore            avgt    5  3466.532 ±  259.464  ms/op
ComplexLargeBenchmark.noPreloadingTransactionalValidationLimit     avgt    5   970.873 ±   66.323  ms/op
ComplexLargeBenchmark.shaclNothingToValidateTransactionsPreloaded  avgt    5     0.109 ±    0.004  ms/op

@hmottestad
Copy link
Contributor Author

Performance degradation seems to be related to TargetClass and the removal of a call to Unique there.

It might not be the Unique, but rather that we were caching the unique and sorted data, while we now just cache the raw unsorted data.

@hmottestad
Copy link
Contributor Author

hmottestad commented Aug 28, 2024

Maybe we should try to optimize the bulk leftOuter/inner joins to not require the data be sorted. The left side can easily just be a LinkedHashMap, that way we preserve any order that there was in the data without requiring the data to be ordered.

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 - sh:pattern validation results can differ between SPARQL vs. transactional validation
1 participant