So, I have 1000 elements to check how relevant they are. Each of these elements requires reading thousands of files (some of which may be the same file for different elements).
This currently implements the use of TPL (async / await), one for each file that it should read, and one for each element that it should check. This works great, except that when I look at it, about the 3rd most expensive feature is TrySteal in the thread pool.
Using the concurrency visual studio viewer, I see that 99% of the time spent in threads spent in concurrently connected items and only 1% in execution. That is what makes me think that I might just create too many tasks (note: I don't use Task.Run anywhere, just waiting).
Will Parellel.For be less overhead than reading a bunch of files using async / wait? How much overhead is expected with a task library?
, , . , , , , , . , , . , , , , , . ( ).
: , , . , , , . Parallel.ForEach(). , Parallel.Foreach() , async, .
Source: https://habr.com/ru/post/1691002/More articles:React Native (iOS) AppRegistry module is not a registered called module (runApplication call) - iosAffirm that an event has been observed - javascriptGoogle Cloud Feature Error: "Unable to decode type from Firestore value" - javascriptJPMS/Jigsaw Отсутствует основной класс в модуле - javaУстановка SKPM (Sketch Plugin Manager) через npm - node.jsIf meta classes in models inherit from an object - pythonWPF - Reducing the flooding effect for a button - c #https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1691005/how-to-programmatically-map-integers-to-const-strings&usg=ALkJrhhw_SfgXJUHoscDlAMDaqU7lmfx9gHow to redirect another page after successfully logging in to nodejs - javascriptfinal variables do not function well in jshell - access-modifiersAll Articles