This content has been marked as final. Show 2 replies
user13789832 wrote:More time than what?
I am able to see that mkdir() method of File API consumes more time in creating directories.
Can any one please suggest if there can be a efficient way of creating directory structure with depth specified as 5 and can be achieved within 1-2 millisecondsThere's no way to guarantee how long it will take. That depends entirely on your environment. If you're creating more than one deep, you might find you get better performance with mkdirs() to create A, B, and C and once, rather than calling mkdir("A"), then mkdir("A/B"), then mkdir("A/B/C").
Otheriwse, no there's no way to make it go faster. If 5-45 ms. is not fast enough (Which sounds really odd! What are you doing that requires you to create directories 5 deep more than 200 times per second?), then you'll just have to pre-create them, or hope that you've got enough spare CPU and I/O available between bursts to create them in a separate thread.
(And other than that very last suggestion of mine, this question has nothing to do with Concurrency. It's more of an I/O question.)