Improve FieldValuesReader performance

FieldValuesReader used to wrap Reader which does a map concatenation on every new instance. This change turns FieldValuesReader into a dedicated class for fields. FieldValuesReader can be called for every object in the heap dump so that's a lot.

Method tracing showed a reduction from ~9% of total analysis time to 0.9% when running ProfiledTest#analyzeLargeDump
4 files changed
tree: b9284728422bb417684a60b3cb57ae0b44ab9360
  1. .buildscript/
  2. .github/
  3. docs/
  4. gradle/
  5. hooks/
  6. leakcanary-android/
  7. leakcanary-android-core/
  8. leakcanary-android-instrumentation/
  9. leakcanary-android-process/
  10. leakcanary-android-sample/
  11. leakcanary-object-watcher/
  12. leakcanary-object-watcher-android/
  13. leakcanary-object-watcher-android-androidx/
  14. shark/
  15. shark-android/
  16. shark-cli/
  17. shark-graph/
  18. shark-hprof/
  19. shark-log/
  20. .gitignore
  21. .travis.yml
  22. build.gradle
  23. detekt-config.yml
  24. gradle.properties
  25. gradlew
  26. LICENSE.txt
  27. mkdocs.yml
  28. README-1.6.md
  29. README.md
  30. settings.gradle
README.md

LeakCanary 🐤

A memory leak detection library for Android.

square.github.io/leakcanary

License

Copyright 2015 Square, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.