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

Use std::string_view for MessageLogger category #31498

Merged
merged 1 commit into from Sep 18, 2020

Conversation

makortel
Copy link
Contributor

PR description:

Resolves #31475. Should avoid one std::string construction when the category is passed in as char const*.

PR validation:

Framework unit tests pass.

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-31498/18447

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @makortel (Matti Kortelainen) for master.

It involves the following packages:

FWCore/MessageLogger

@makortel, @smuzaffar, @cmsbuild, @Dr15Jones can you please review it and eventually sign? Thanks.
@wddgit this is something you requested to watch as well.
@silviodonato, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@makortel
Copy link
Contributor Author

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 17, 2020

The tests are being triggered in jenkins.

@@ -45,7 +45,7 @@ namespace edm {
public:
// --- birth/death:
//
ErrorObj(const ELseverityLevel& sev, const ELstring& id, bool verbatim = false);
ErrorObj(const ELseverityLevel& sev, std::string_view id, bool verbatim = false);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Dr15Jones Given that ELseverityLevel is essentially an int, I wonder if we should pass it around by value instead of by reference?

Copy link
Contributor

Choose a reason for hiding this comment

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

Passing by value makes sense to me. (Much of the internals of MessageLogger are C++98 era of code)

@Dr15Jones
Copy link
Contributor

Could you also go the extra mile and get rid of all references to ELstring? It is completely unnecessary as we already directly depend upon std::string in our interfaces.

@makortel
Copy link
Contributor Author

Could you also go the extra mile and get rid of all references to ELstring?

Happy to.

@kpedro88
Copy link
Contributor

thanks @makortel!

@cmsbuild
Copy link
Contributor

+1
Tested at: f77d8b1
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-875a32/9417/summary.html
CMSSW: CMSSW_11_2_X_2020-09-17-1100
SCRAM_ARCH: slc7_amd64_gcc820

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-875a32/9417/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 35
  • DQMHistoTests: Total histograms compared: 2540471
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2540448
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 34 files compared)
  • Checked 149 log files, 22 edm output root files, 35 DQM output files

@makortel
Copy link
Contributor Author

+1

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @silviodonato, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@qliphy
Copy link
Contributor

qliphy commented Sep 18, 2020

+1

@cmsbuild cmsbuild merged commit c6d98e1 into cms-sw:master Sep 18, 2020
@makortel makortel deleted the stringviewMessageLogger branch September 18, 2020 14:45
@makortel makortel mentioned this pull request Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MessageLogger constructors should accept string_view
5 participants