Skip to content

Is there a faster way? #192

Answered by gdbarron
DrMarkX asked this question in Q&A
Jun 8, 2022 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

@DrMarkX, apologize for the delay, here are a few thoughts:

  • Only bring back the properties you actually need as this will reduce the amount of data coming back and definitely speed things up
  • Minimize the use of -like in your filter as that will always take longer
  • You can get all the ritm data in one call once you have your list of tasks
  • When getting the user name, just get the 1 property and use -AsValue
  • Instead of adding to an array with +=, use arraylist or a generic list. For a few hundred items it won't make a huge impact, but += will always be slower.
  • You could also execute the loop in -Parallel, but would need to use a thread safe collection or simply set the foreach to a variable …

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@DrMarkX
Comment options

@DrMarkX
Comment options

@gdbarron
Comment options

@DrMarkX
Comment options

Answer selected by DrMarkX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants