Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.15.1
-
None
-
None
-
Improved FSDirectory.mkdirs(...) performance. In NNThroughputBenchmark-create, the ops per sec in was improved ~54%.
Description
FSDirectory.mkdirs(...) creates List<String> v to store all dirs. e.g.
//Suppose src = "/foo/bar/bas/" //Then, v = {"/", "/foo", "/foo/bar", "/foo/bar/bas"}
For each directory string cur in v, no matter cur already exists or not, it will try to do a unprotectedMkdir(cur, ...). Then, cur is parsed to byte[][] in INodeDirectory.addNode (...).
We don't need to do the parsing for each string in v. Instead, byte[][] should be stored. Also, the loop should not continue once it finds an existing subdirectory.