<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I am familiar with it, just not all of the benchmarks by name.<div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 17, 2017, at 3:04 PM, David P Grove <<a href="mailto:groved@us.ibm.com" class="">groved@us.ibm.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><p class="">Sorry, I shouldn't have assumed that everyone know what the Computer Language Benchmark Game was.<br class=""><br class="">There's a set of 10 toy benchmarks written in 30 different languages that are available here: <a href="http://benchmarksgame.alioth.debian.org/" class="">http://benchmarksgame.alioth.debian.org/</a> The webpage also lets you see the results of regular performance runs and see how the various programs stack up against each other.<br class=""><br class="">As usual with small benchmarks, there are lots of ways in which the programs aren't realistic. <br class=""><br class="">After dispatch became available on Linux with Swift 3, I had a side project of going through the Swift implementations and adding concurrency to a few Swift programs that didn't have it already.<br class=""><br class="">regex-dna is the main outlier for Swift (which is why I had profiled it). There's enough ARC overhead that using dispatch actually made it slower...<br class=""> The sequential version for of regex-dna for Swift is: <a href="http://benchmarksgame.alioth.debian.org/u64q/program.php?test=regexdna&lang=swift&id=2" class="">http://benchmarksgame.alioth.debian.org/u64q/program.php?test=regexdna&lang=swift&id=2</a><br class=""> My slower concurrent version is: <a href="http://benchmarksgame.alioth.debian.org/u64q/program.php?test=regexdna&lang=swift&id=3" class="">http://benchmarksgame.alioth.debian.org/u64q/program.php?test=regexdna&lang=swift&id=3</a><br class=""><br class="">I suspect that the main fix for improving the performance of this program is actually doing something in CoreFoundation, but I got sidetracked and didn't finish looking into it.<br class=""><br class="">--dave<br class=""><br class=""><span id="cid:1__=0ABB0A59DFEFF22D8f9e8a93df938690918c0AB@"><graycol.gif></span><font color="#424282" class="">Michael Gottesman ---02/17/2017 05:32:03 PM---> On Feb 17, 2017, at 11:30 AM, David P Grove via swift-dev <<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>> wrote: ></font><br class=""><br class=""><font size="2" color="#5F5F5F" class="">From: </font><font size="2" class="">Michael Gottesman <<a href="mailto:mgottesman@apple.com" class="">mgottesman@apple.com</a>></font><br class=""><font size="2" color="#5F5F5F" class="">To: </font><font size="2" class="">David P Grove/Watson/IBM@IBMUS</font><br class=""><font size="2" color="#5F5F5F" class="">Cc: </font><font size="2" class="">Jiho Choi <<a href="mailto:jray319@gmail.com" class="">jray319@gmail.com</a>>, swift-dev <<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>></font><br class=""><font size="2" color="#5F5F5F" class="">Date: </font><font size="2" class="">02/17/2017 05:32 PM</font><br class=""><font size="2" color="#5F5F5F" class="">Subject: </font><font size="2" class="">Re: [swift-dev] Profiling ARC</font><br class=""><font size="2" color="#5F5F5F" class="">Sent by: </font><font size="2" class=""><a href="mailto:mgottesman@apple.com" class="">mgottesman@apple.com</a></font><br class=""></p><hr width="100%" size="2" align="left" noshade="" style="color:#8091A5; " class=""><br class=""><br class=""><br class="">
<ul class=""><ul class=""><font size="4" class="">On Feb 17, 2017, at 11:30 AM, David P Grove via swift-dev <</font><a href="mailto:swift-dev@swift.org" class=""><u class=""><font size="4" color="#0000FF" class="">swift-dev@swift.org</font></u></a><font size="4" class="">> wrote:</font><br class=""><p class=""><a href="mailto:swift-dev-bounces@swift.org" class=""><tt class=""><u class=""><font size="4" color="#0000FF" class="">swift-dev-bounces@swift.org</font></u></tt></a><tt class=""><font size="4" class=""> wrote on 02/16/2017 09:48:28 PM:<br class="">> <br class="">> I was curious about the overhead of ARC and started profiling some <br class="">> benchmarks found in the Computer Language Benchmark Game (http://<br class="">> </font></tt><a href="http://benchmarksgame.alioth.debian.org/u64q/measurements.php?lang=swift" class=""><tt class=""><u class=""><font size="4" color="#0000FF" class="">benchmarksgame.alioth.debian.org/u64q/measurements.php?lang=swift</font></u></tt></a><tt class=""><font size="4" class="">). <br class="">> So far, it seems that ARC sequence optimization is surprisingly good<br class="">> and most benchmarks don't have to perform ARC operations as often as<br class="">> I expected. I have some questions regarding this finding.<br class="">> <br class="">> I compiled all benchmarks with "-O -wmo" flags and counted the <br class="">> number of calls to ARC runtime (e.g., swift_rt_swift_retain) using Pin.<br class="">> <br class="">> 1. Reference counting is considered to have high overhead due to <br class="">> frequent counting operations which also have to be atomic. At least<br class="">> for the benchmarks I tested, it is not the case and there is almost <br class="">> no overhead. Is it expected behavior? Or is it because the <br class="">> benchmarks are too simple (they are all single-file programs)? How <br class="">> do you estimate the overhead of ARC would be?<br class="">> </font></tt><font size="4" class=""><br class=""></font><tt class=""><font size="4" class=""><br class="">hmm, I wonder if your method of profiling is really finding all the ARC operations. The Swift version of regex-dna is about 25x slower than the Java version (on Linux). I looked at some prof profiles about a month ago and at the time roughly 80% of all execution samples were attributed to swift_retain/swift_release operations coming from CoreFoundation's regex implementation. </font></tt></p></ul></ul><font size="4" class="">Question. Where is this regex-dna benchmark, is it in the swift benchmark suite?</font><ul class=""><ul class=""><tt class=""><font size="4" class=""><br class="">--dave</font></tt><font size="4" class=""><br class=""></font><i class=""><font size="4" class=""><br class="">(See attached file: regex-dna.svg)</font></i><p class=""><font size="4" class=""><regex-dna.svg>_______________________________________________<br class="">swift-dev mailing list</font><u class=""><font size="4" color="#0000FF" class=""><br class=""></font></u><a href="mailto:swift-dev@swift.org" class=""><u class=""><font size="4" color="#0000FF" class="">swift-dev@swift.org</font></u></a><font size="4" class=""><br class=""></font><font size="4" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-dev" class="">https://lists.swift.org/mailman/listinfo/swift-dev</a></font></p></ul></ul><br class=""><br class=""><br class="">
</div>
</div></blockquote></div><br class=""></div></body></html>