IARC-CSU / CanReg5

CanReg5 is a multi user, multi platform, open source tool to input, store, check and analyse cancer registry data.
http://www.iacr.com.fr/CanReg5
GNU General Public License v3.0
24 stars 13 forks source link

C24c: Duplicate search: other recommendations #102

Closed infotel4iarc closed 2 years ago

infotel4iarc commented 2 years ago

• The method DatabaseRecord#getVariable is called very often and it uses toLowerCaseStandardized, which consumes cpu each time. • The method releaseResultSet is called outside of a “finally” block, which means that the release could not be done if an exception happens.

fbinfotel commented 2 years ago

I started working on the issue on 31/08/2021 . The code can be found on this repo : https://github.com/infotel4iarc/CanReg5/tree/feature/C24c

I added a finally block to all method containing a releaseResultSet function in order to be able to release the resultSet if an exception is thrown.

The branch needs to be reviewed

fbinfotel commented 2 years ago

Before the optimization, The method DatabaseRecord#getVariable was called very often and it used toLowerCaseStandardized, which consumes CPU each time. After, the optimization (C24a) this method is used when the data are retrieved from the database. So the CPU consumption is much lower, that why there was no need to modify the getVariable method. On the other Hand, the modifications on the releaseResultSet were done to be able to release the resultSet even if an exception is thrown.

The review is done, so the ticket is finished.