I tried creating 10 files containing 100000 hardcoded texts using Thread pool mechanism and also Sequential execution mechanism for performance testing.
It looked like Sequential exection performs much better than Thread pool. Can somebody tell me if I'm wrong in implementing the Thread pool program or this is what the performance is. Sequential approach takes 875 milli seconds to write 10 files. Multi Threading takes 5000 milli seconds. This is too much.
As of now, I've a sequential file creation in my program. But it is not performing well. I thought of using multithreaded approach using Thread pool mechanism. But Sequential execution was outstanding compared to multi threaded approach with Thread pool.
This is very urgent for me. Can somebody please help me with this.
Attached the code for both the approaches.
Thanks,
Naveen