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

Open INI file less #3688

Merged
merged 18 commits into from
Apr 26, 2021
Merged

Open INI file less #3688

merged 18 commits into from
Apr 26, 2021

Conversation

iCollin
Copy link
Collaborator

@iCollin iCollin commented Apr 19, 2021

Fixes #2850

This PR is ready for review.

Risk

This PR makes no API changes.

Testing Plan

Change INI value, run SDL core, ensure Core read new INI value
Unit Tests and ATF tests

Summary

Refactor INI parsing to reduce the number of times the ini file is opened. This goal is achieved through an update to Profile::UpdateValues:

  1. INI file is opened
  2. all values from the file are read into a smart_object
  3. INI files is closed
  4. Member variables are assigned from values in smart_object

Changelog

Enhancements
  • SDL Core should open the ini file many times less
CMake
  • transport_manager now requires smart_object include
  • config_profile now depends on smart_object
  • config_profile_test now depends on smart_object

Tasks Remaining:

  • Fix unit tests
  • Remove ini_file changes
  • Deprecate ini_file?

CLA

@iCollin iCollin changed the title parse all values from one ini file open open INI file less Apr 19, 2021
@jacobkeeler jacobkeeler changed the title open INI file less Open INI file less Apr 21, 2021
src/components/config_profile/src/ini_file.cc Outdated Show resolved Hide resolved
src/components/config_profile/src/ini_file.cc Outdated Show resolved Hide resolved
src/components/config_profile/src/ini_file.cc Outdated Show resolved Hide resolved
src/components/config_profile/src/ini_file.cc Outdated Show resolved Hide resolved
src/components/config_profile/src/ini_file.cc Outdated Show resolved Hide resolved
src/components/config_profile/src/ini_file.cc Outdated Show resolved Hide resolved
src/components/config_profile/src/ini_file.cc Outdated Show resolved Hide resolved
src/components/config_profile/src/ini_file.cc Outdated Show resolved Hide resolved
src/components/config_profile/src/ini_file.cc Outdated Show resolved Hide resolved
@iCollin
Copy link
Collaborator Author

iCollin commented Apr 22, 2021

PR description is updated for the new approach

Copy link
Contributor

@jacobkeeler jacobkeeler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, should still deprecate ini_read_value()

src/components/config_profile/src/profile.cc Show resolved Hide resolved
@iCollin iCollin merged commit 74ea4bb into develop Apr 26, 2021
@iCollin iCollin deleted the fix/ini_updates branch April 26, 2021 19:16
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.

None yet

2 participants