SpineEventEngine / core-java

The Java implementation of the framework core
https://spine.io
Apache License 2.0
36 stars 12 forks source link

Improve the performance of `ColumnMapping` lookup #1457

Closed armiol closed 2 years ago

armiol commented 2 years ago

In scope of this changeset, the peformance of ColumnMapping lookup is improved by caching the results per column type.

Recently, a new version of Spine modelCompiler has been developed. Its main feature is that the validation codegen is performed via ProtoData library with Spine's Validation extensions to it. However, at this point, the performance of the corresponding build tasks is low, dragging the build duration into dozens of minutes.

The primary effort on optimization is concentrated in Validation library (see this PR). However, some bits may be improved in spine-server artifact as well — since Validation library itself is a Spine-based application.

Therefore, this changeset introduces the ColumnMapping performance improvements, so that they could be later used in Validation library.

At the moment, Validation library uses an "old" (pre-ProtoData) version of spine-server. So, in this changeset, a minimal set of changes was made to keep the resulting spine-server artifact as close to the one used currently as possible — in terms of versions of transitive dependencies.

codecov[bot] commented 2 years ago

Codecov Report

Merging #1457 (4954bb7) into master (3850c8b) will decrease coverage by 0.02%. The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master    #1457      +/-   ##
============================================
- Coverage     91.47%   91.44%   -0.03%     
  Complexity     4979     4979              
============================================
  Files           626      627       +1     
  Lines         15347    15358      +11     
  Branches        894      894              
============================================
+ Hits          14038    14044       +6     
- Misses         1004     1006       +2     
- Partials        305      308       +3     
armiol commented 2 years ago

@dmdashenkov PTAL.