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

Deprecate hierarchical config #2421

Merged
merged 1 commit into from
Mar 9, 2020
Merged

Conversation

arturbosch
Copy link
Member

@arturbosch arturbosch commented Mar 9, 2020

Needs rebase on top of #2420. Please review just the last commit.

A Config is a long lived object and is derived via subConfig a lot.
Keeping track of the parent it was derived, creates long-lived object chains which takes the GC longer to release them.
It can even lead to OOM if detekt get's embedded in an other application which reuses the top most Config object.
The property 'parentPath' of the Config interface can be used as a replacement for parent.key calls.
I consider the introduction of HierarchicalConfig.Parent as a bug and will remove it after two minor versions.

@arturbosch arturbosch added this to the 1.7.0 milestone Mar 9, 2020
@codecov-io
Copy link

codecov-io commented Mar 9, 2020

Codecov Report

Merging #2421 into master will decrease coverage by 0.01%.
The diff coverage is 88.88%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2421      +/-   ##
============================================
- Coverage     82.85%   82.83%   -0.02%     
+ Complexity     2174     2166       -8     
============================================
  Files           356      356              
  Lines          6137     6136       -1     
  Branches       1121     1119       -2     
============================================
- Hits           5085     5083       -2     
- Misses          476      478       +2     
+ Partials        576      575       -1
Impacted Files Coverage Δ Complexity Δ
...tlab/arturbosch/detekt/api/internal/EmptyConfig.kt 66.66% <ø> (-16.67%) 4 <0> (-1)
...ain/kotlin/io/gitlab/arturbosch/detekt/api/Rule.kt 94.11% <100%> (ø) 13 <1> (-4) ⬇️
...n/kotlin/io/gitlab/arturbosch/detekt/api/Config.kt 94.11% <100%> (+0.36%) 0 <0> (ø) ⬇️
...itlab/arturbosch/detekt/api/internal/BaseConfig.kt 86.36% <100%> (+0.64%) 10 <2> (-2) ⬇️
...itlab/arturbosch/detekt/api/internal/YamlConfig.kt 76.66% <83.33%> (-0.26%) 9 <1> (+1)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 79fc19d...977f40b. Read the comment docs.

@arturbosch arturbosch force-pushed the deprecate-hierarchical-config branch from 74c6e34 to e47406c Compare March 9, 2020 11:18


A Config is a long lived object and is derived via subConfig a lot.
Keeping track of the parent it was derived, creates long-lived object chains which takes the GC longer to release them.
It can even lead to OOM if detekt get's embedded in an other application which reuses the top most Config object.
The property 'parentPath' of the Config interface can be used as a replacement for parent.key calls.
@arturbosch arturbosch force-pushed the deprecate-hierarchical-config branch from e47406c to 977f40b Compare March 9, 2020 22:51
@arturbosch arturbosch merged commit 62d7dd7 into master Mar 9, 2020
@arturbosch arturbosch deleted the deprecate-hierarchical-config branch March 9, 2020 23:57
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.

4 participants