platyPS icon indicating copy to clipboard operation
platyPS copied to clipboard

Update-MarkdownHelp should support multiple threads to speed up large projects

Open theficus opened this issue 7 years ago • 5 comments

My project has several hundred cmdlets. I'd like to integrate platyPS into our build workflow to automatically generate stub documentation when there's changes, but with so many cmdlets, it adds 10-15 minutes to the build for Update-MarkdownHelpModule to complete.

Supporting a thread pool versus reading every single file sequentially could greatly improve performance with very large projects.

theficus avatar Oct 11 '17 21:10 theficus

The main source of slowness in the project is our home-written markdown parser. #112 will be awesome to implement and finally switch to markdig.

I like the idea of using threads, we can apply it to the markdown parsing for short term perf gains.

Reading files in parallel (IO itself) would not really help because:

  1. reading files is a pretty small part of the program
  2. if you have HDD, reading files in parallel can actually slow down the overall time, because of additional spinning for seeks.

vors avatar Oct 12 '17 15:10 vors

Great info. I hadn't dug into the implementation so I just assumed it was due to sequential file access. :) Any perf improvements would be much welcome. I'd love to get this integrated into our build workflow and this is the only blocker right now. With 700+ cmdlets it takes about 10 minutes on average to run.

theficus avatar Oct 13 '17 07:10 theficus

I can't help but wonder in reading this if your module needs a little refactoring. 700 commands is a very large number of commands. The most I can find on my desktop is v2 of the Hyper-V module with 249 exported commands. Is there really no distinguishing element where you could group commands into modules? Or even using submodules would help you.

jdhitsolutions avatar Dec 14 '17 15:12 jdhitsolutions

The biggest I have seen so far was Skype MS modules family, about ~1k. So big modules are a reality for enterprises :)

vors avatar Dec 14 '17 16:12 vors

It's a very large module for a very large product. There's really no practical way to break it up into submodules - it's already some 20 assemblies and a single psd1.

-- Sent from my phone. Expect brevity and typos.

On Dec 14, 2017, at 07:57, Jeff Hicks <[email protected]mailto:[email protected]> wrote:

I can't help but wonder in reading this if your module needs a little refactoring. 700 commands is a very large number of commands. The most I can find on my desktop is v2 of the Hyper-V module with 249 exported commands. Is there really no distinguishing element where you could group commands into modules? Or even using submodules would help you.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/PowerShell/platyPS/issues/315#issuecomment-351752380, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ALGV5GegjdaDtRyVwRRoZGAN4X49tb42ks5tAUVvgaJpZM4P2K3s.

theficus avatar Dec 15 '17 02:12 theficus

The performance Microsoft.PowerShell.PlatyPS is drastically improved.

sdwheeler avatar May 31 '24 15:05 sdwheeler