Tyagi-Gaurav / Movie

1 stars 0 forks source link

[TECH_TASK] File based scratch module #340

Open Tyagi-Gaurav opened 2 years ago

Tyagi-Gaurav commented 2 years ago

What is the problem that we're trying to solve? Create a practice module that has large input files that can serve as input.

Checklist of Tasks to do

Use cases

Tyagi-Gaurav commented 2 years ago

Things to do.

Create separate interface for each of the above files.* Returns a Json

Tyagi-Gaurav commented 2 years ago

Reading all the items from the file is quick, but transforming and storing in map slows it down. Have verified that reading the file is not slow and all lines are read quickly.

Tyagi-Gaurav commented 2 years ago

Reading files using inputStream with block size of 2MB and then using in-memory manipulation of byte array, keep titles along with their file pointers works very well. Read time reduces to 40 seconds.

Tyagi-Gaurav commented 2 years ago

Using file channels and Byte Buffer did not change the load time for the files.