randomJumpResultsInBadPerformance() failing for the past week

I have been trying to optimise my code for SourceFileVersionLinkedListImpl and SourceFileHandlerLinkedLiskImpl for the past week trying to pass the assessment for module 5, but it keeps failing. I have looked at and tried all the FAQs and posts related to that topic, but to no avail.
Also, I am not sure if I implemented deep copy at the right location. The TODOs were not very clear.

Are you able to see what time you are getting in the assessment ?
It should be below 15 seconds.
Did you follow the FAQ


There’s also a link attached for your reference there.
First look at how much time you are getting.

Yes, as I wrote in my post, I have already looked at the FAQ and other posts. I understand that I need to optimise, but I havent been able to make any more headway. At the moment, the timeTaken for this test case is around 25 seconds. As you said, it should be below 15 seconds. I have implemented all the suggestions given in the FAQ as well as the multiple posts.
Here is what I have tried so far:

  • Created a copy constructor for SourceFileVersionLinkedListImpl that takes another fileversion object. It retrieves the filename and creates a deep copy of lines (I used stream api to make it even faster).
  • In loadFile() function of SourveFileHandlerLinkedListImpl.java, I removed any unnecessary variables and loops to reduce the time complexity.
  • The loadFile() also creates a new sourceFileVersion object using the sourceFileVersion(fileInfo) constructor. I implemented this constructor to also create a deep copy of “lines”.
  • Removed all unnecessary variables and loops in editLines() function of SourceFileHandlerLinkedListImpl.java.
  • Removed all unnecessary variables and loops in getLinesFrom() function of SourceFileVersionLinkedListImpl.java.
  • Already using subList() instead of loops.
  • Updated runner files
    I am only mentioning the optimisations that are directly related to this particular test case. What should I do next?

Okay, tell me once you are online, i’ll check your workspace.

@Rahul-Crio.do, please take a look at my workspace.

Closing this topic as your issue is resolved by the mentor. If it is still not resolved, Kindly un-mark the accepted solution or create a new topic and post this question as a reference link in the description of the new topic.