nanoapi-io / napi

Transpile your monolithic codebases to microservices in seconds
https://nanoapi.io
Other
171 stars 3 forks source link

Enhance Split Function Performance with Node.js Worker Threads for Parallel Processing #41

Open florianbgt opened 1 day ago

florianbgt commented 1 day ago

Description:

The split function currently runs sequentially, impacting performance for larger projects. By leveraging Node.js Worker Threads, we can enable concurrent processing, significantly improving speed and efficiency.

Proposed Solution:

Refactor the split function to utilize Worker Threads, allowing parallel execution of splits. Set the default number of threads to automatically detect the optimal number based on available system resources. Add an option to override the default thread count through a CLI flag or configuration file setting. Ensure robust error handling and logging for each worker to maintain visibility and traceability. Expected Outcome:

Implementing parallel processing should lead to faster split operations, enhancing the CLI's performance, particularly when handling multiple endpoints or larger APIs. The ability to customize thread count provides flexibility for users to adjust performance according to their system’s capacity.