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

Fix container inefficiency in GenericFastaHeaderParser.java #1089

Merged
merged 2 commits into from Apr 23, 2024

Conversation

cinsttool
Copy link
Contributor

Hi,

We find that there exist container inefficiency in GenericFastaHeaderParser.java.

In particular, at lines 96 and 97 in GenericFastaHeaderParser.java, the for loop keep allocating the data array and transform container object values to array, which incurs redundant memory allocation and container operations.

We discovered the above containers inefficiencies by our tool cinst. The patch is submitted. Could you please check and accept it? We have tested the patch on our PC. The patched program works well.

@cinsttool
Copy link
Contributor Author

We cannot figure out why the CI is failing because the error still occurs even after we undo the patch.

@aalhossary
Copy link
Member

aalhossary commented Apr 2, 2024

The PR looks good to me.
The error log is

Error:  org.biojava.nbio.structure.io.TestQuaternaryStructureProviders.test5LDH  Time elapsed: 1.061 s  <<< FAILURE!
java.lang.AssertionError: Bioassembly 3 for PDB id 5LDH should fail with a StructureException!
	at org.biojava.nbio.structure.io.TestQuaternaryStructureProviders.test5LDH(TestQuaternaryStructureProviders.java:69)
Error:  org.biojava.nbio.structure.io.TestQuaternaryStructureProviders.testGetNrBioAssemblies5LDH  Time elapsed: 0.042 s  <<< FAILURE!
java.lang.AssertionError: There should be 4 bioassemblies for 5LDH, see github issue #230 expected:<4> but was:<1>
	at org.biojava.nbio.structure.io.TestQuaternaryStructureProviders.testGetNrBioAssemblies5LDH(TestQuaternaryStructureProviders.java:104)

Which does not look relevant here.

Copy link
Contributor

@josemduarte josemduarte left a comment

Choose a reason for hiding this comment

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

LGTM thanks

The test problems is unrelated. I'll push a fix to master.

@josemduarte
Copy link
Contributor

Could you merge master into your branch to trigger the tests again?

@cinsttool
Copy link
Contributor Author

We could not pass the biojava-integrationtest.

The error log is

2024-04-10T16:06:21.2084227Z 15:56:19 [main] WARN  org.biojava.nbio.core.util.FileDownloadUtils - could not find expected file size for resource http://prodata.swmed.edu/ecod/distributions/ecod.develop204.domains.txt.
2024-04-10T16:06:21.2092790Z 16:06:21 [main] WARN  org.biojava.nbio.structure.ecod.EcodFactory - Could not get Ecod version, or file is corrupted
2024-04-10T16:06:21.2094379Z java.net.SocketTimeoutException: Connect timed out

Maybe http://prodata.swmed.edu/ecod/distributions/ecod.develop204.domains.txt is unavailable.

@josemduarte
Copy link
Contributor

Maybe http://prodata.swmed.edu/ecod/distributions/ecod.develop204.domains.txt is unavailable.

Indeed, it looks like it has been down for many days now. Which is odd. It's a popular resource and there's even a very recent publication about it (https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1011586). I'll see if I can contact them.

@cinsttool
Copy link
Contributor Author

Maybe http://prodata.swmed.edu/ecod/distributions/ecod.develop204.domains.txt is unavailable.

Hi, we have found that this file is re-available.

@josemduarte
Copy link
Contributor

Thanks... tests are passing finally!

@josemduarte josemduarte merged commit e7c31d7 into biojava:master Apr 23, 2024
3 checks passed
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

3 participants