[midPoint-git] [Evolveum/prism] ad504c: Stop iterating if querying by compile time class

mederly noreply at github.com
Wed Nov 22 12:35:22 CET 2023


  Branch: refs/heads/support-4.7
  Home:   https://github.com/Evolveum/prism
  Commit: ad504c10dde3085ae3a457a332d3b8b89fd89494
      https://github.com/Evolveum/prism/commit/ad504c10dde3085ae3a457a332d3b8b89fd89494
  Author: Pavol Mederly <mederly at evolveum.com>
  Date:   2023-11-22 (Wed, 22 Nov 2023)

  Changed paths:
    M infra/prism-api/src/main/java/com/evolveum/midpoint/prism/schema/MutablePrismSchema.java
    M infra/prism-impl/src/main/java/com/evolveum/midpoint/prism/impl/schema/DomToSchemaPostProcessor.java
    M infra/prism-impl/src/main/java/com/evolveum/midpoint/prism/impl/schema/PrismSchemaImpl.java

  Log Message:
  -----------
  Stop iterating if querying by compile time class

The PrismSchemaImpl#findTypeDefinitionByCompileTimeClass iterated
through all definitions in given schema. This method is indirectly
used at many places, e.g., in asPrismContainerValue(). So, by replacing
the iteration by a hash map lookup, substantial time can be spared.

To be tested, measured, and improved.

(cherry picked from commit 531be1846ba89c5e0585e3429c3e424318bdd0b1)


  Commit: fdeec7e63990c8e8a32500ec8089e23200e7a0c2
      https://github.com/Evolveum/prism/commit/fdeec7e63990c8e8a32500ec8089e23200e7a0c2
  Author: Pavol Mederly <mederly at evolveum.com>
  Date:   2023-11-22 (Wed, 22 Nov 2023)

  Changed paths:
    M infra/prism-impl/src/main/java/com/evolveum/midpoint/prism/impl/ItemImpl.java

  Log Message:
  -----------
  Stop creating deltas during prism equality checks

This improves the "fast fail" diff for equality checks originally
introduced in a73dcc4facb8b96dac664d47fe539813de9b6f29: we no longer
create deltas when comparing prism values.

(cherry picked from commit 1d5f89113839df5eb732ad7b1def97e285065889)


  Commit: b8f1ea7caa0957996a761f199005587265e55fdc
      https://github.com/Evolveum/prism/commit/b8f1ea7caa0957996a761f199005587265e55fdc
  Author: Pavol Mederly <mederly at evolveum.com>
  Date:   2023-11-22 (Wed, 22 Nov 2023)

  Changed paths:
    M infra/prism-impl/src/main/java/com/evolveum/midpoint/prism/impl/schema/PrismSchemaImpl.java
    M infra/prism-impl/src/main/java/com/evolveum/midpoint/prism/impl/schema/SchemaDescriptionImpl.java
    M infra/prism-impl/src/main/java/com/evolveum/midpoint/prism/impl/schema/SchemaRegistryImpl.java

  Log Message:
  -----------
  Remove two iterative lookups

1. PrismSchemaImpl#findItemDefinitionsByCompileTimeClass iterated
through all definitions in given schema. Its results are now cached.

2. SchemaRegistryImpl#findSchemaByCompileTimeClass iterated through
all schemas. The schemas are now put into a map keyed by compile-time
class package.

(cherry picked from commit e84729be2c27c2e2521c44abba7125dbb3c4f1d7)


  Commit: 8cc04e081fa5186eb283a92b0aade76e6dd71825
      https://github.com/Evolveum/prism/commit/8cc04e081fa5186eb283a92b0aade76e6dd71825
  Author: Pavol Mederly <mederly at evolveum.com>
  Date:   2023-11-22 (Wed, 22 Nov 2023)

  Changed paths:
    M infra/prism-api/src/main/java/com/evolveum/midpoint/prism/AbstractFreezable.java

  Log Message:
  -----------
  Skip freezing already-frozen objects

Re-freezing of a frozen object should be avoided. It is defensive
but inefficient.

(cherry picked from commit f389d5c8f9abfa7c3192416a563dbda7550aa3ee)


  Commit: df84861045cedcda7ffa63fbbc7b51c66061632f
      https://github.com/Evolveum/prism/commit/df84861045cedcda7ffa63fbbc7b51c66061632f
  Author: Pavol Mederly <mederly at evolveum.com>
  Date:   2023-11-22 (Wed, 22 Nov 2023)

  Changed paths:
    M infra/prism-api/src/main/java/com/evolveum/midpoint/prism/ParsingContext.java
    M infra/prism-api/src/main/java/com/evolveum/midpoint/prism/PrismParser.java
    M infra/prism-api/src/main/java/com/evolveum/midpoint/prism/PrismParserNoIO.java
    M infra/prism-impl/src/main/java/com/evolveum/midpoint/prism/impl/ParsingContextImpl.java
    M infra/prism-impl/src/main/java/com/evolveum/midpoint/prism/impl/PrismContainerImpl.java
    M infra/prism-impl/src/main/java/com/evolveum/midpoint/prism/impl/marshaller/PrismParserImpl.java
    M infra/prism-impl/src/main/java/com/evolveum/midpoint/prism/impl/marshaller/PrismParserImplNoIO.java
    M infra/prism-impl/src/main/java/com/evolveum/midpoint/prism/impl/marshaller/PrismUnmarshaller.java

  Log Message:
  -----------
  Use "addIgnoringEquivalents" where possible

In particular, when parsing data from trusted sources (like the repo),
we can skip checking for equivalent values. This can be problematic
only when the schema changes, but I assume it's not worth the waste
of CPU cycles by repeated equivalence checking.

Trusted sources are marked by ParsingContext#fastAddOperations.

(cherry picked from commit 382f87be90b20f4ad67a95a9f1038ee653cee98a)


  Commit: af1b0bcbd01da5cac787b6c9625532213993bffc
      https://github.com/Evolveum/prism/commit/af1b0bcbd01da5cac787b6c9625532213993bffc
  Author: Pavol Mederly <mederly at evolveum.com>
  Date:   2023-11-22 (Wed, 22 Nov 2023)

  Changed paths:
    M infra/util/src/main/java/com/evolveum/midpoint/util/MiscUtil.java

  Log Message:
  -----------
  Add some auxiliary methods

(partially cherry picked from commit
e545e103a1422a601db6c7f9897ead1c69c5c430)


Compare: https://github.com/Evolveum/prism/compare/af6abc5432e0...af1b0bcbd01d


More information about the midPoint-svn mailing list