{"id":370,"date":"2009-09-25T13:16:51","date_gmt":"2009-09-25T12:16:51","guid":{"rendered":"http:\/\/people.iola.dk\/arj\/?p=370"},"modified":"2009-09-25T13:16:51","modified_gmt":"2009-09-25T12:16:51","slug":"profiling-multithreading-applications","status":"publish","type":"post","link":"https:\/\/people.iola.dk\/arj\/2009\/09\/25\/profiling-multithreading-applications\/","title":{"rendered":"Profiling multithreading applications"},"content":{"rendered":"<p>I&#8217;ve written about profiling <a href=\"http:\/\/people.iola.dk\/arj\/2006\/02\/08\/profiling-mmsv2\/\">before<\/a> in the general case. But when it comes to <a href=\"http:\/\/en.wikipedia.org\/wiki\/Multithreading\">multithreading<\/a>, there are a few more factors to consider such as lock contention and cache invalidation that affect performance. And this is where <a href=\"http:\/\/0pointer.de\/blog\/projects\/mutrace\">mutrace<\/a> (mutex profiler) comes into the picture. The profiler has a very low overhead compared (no perceived delay for me) to other solutions and gives quite nice results. I tested it on <a href=\"http:\/\/mymediasystem.org\/\">My Media System<\/a> (C++) and <a href=\"http:\/\/www.iola.dk\/nemo\/\">Nemo<\/a> (C#) and got interesting results for both. I knew more or less what the results for mms would be, but the results for Nemo was a bit suprising. The lock contention was significantly higher than for mms, even though I didn&#8217;t really use a multithreaded design for Nemo. So I guess it comes from the mono platform itself. Sadly it seems that mono programs aren&#8217;t compiled with -rdynamic, so the results that one gets are quite hard to decipher.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve written about profiling before in the general case. But when it comes to multithreading, there are a few more factors to consider such as lock contention and cache invalidation that affect performance. And this is where mutrace (mutex profiler) comes into the picture. The profiler has a very low overhead compared (no perceived delay [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[296,295,94,191,300,289],"class_list":["post-370","post","type-post","status-publish","format-standard","hentry","category-profiling","tag-net","tag-c","tag-linux","tag-mono","tag-profiling","tag-programming"],"_links":{"self":[{"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/posts\/370","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/comments?post=370"}],"version-history":[{"count":2,"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/posts\/370\/revisions"}],"predecessor-version":[{"id":372,"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/posts\/370\/revisions\/372"}],"wp:attachment":[{"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/media?parent=370"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/categories?post=370"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/people.iola.dk\/arj\/wp-json\/wp\/v2\/tags?post=370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}