<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p><font size="+1">oups! typo!</font></p>
<p><font size="+1">the real test:</font></p>
<p><font style="font-family: Helvetica; font-style: normal;
font-variant-caps: normal; font-weight: normal; letter-spacing:
normal; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255);" class="" size="+1">let
simpleTest = Float(abs(11 - -3) + abs(4.5 - -4)) //!<br
class="">
print ("simpleTest: \(simpleTest)")</font></p>
<br>
<div class="moz-cite-prefix">Le 07/09/2016 à 10:33, Alex Blewitt a
écrit :<br>
</div>
<blockquote
cite="mid:4362827E-2518-46A1-8D4F-C6F516221F1A@apple.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
On 7 Sep 2016, at 15:11, louislepegue via swift-users <<a
moz-do-not-send="true" href="mailto:swift-users@swift.org"
class="">swift-users@swift.org</a>> wrote:<br class="">
<div>
<blockquote type="cite" class=""><br
class="Apple-interchange-newline">
<div class=""><font style="font-family: Helvetica; font-style:
normal; font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none; white-space:
normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255,
255, 255);" class="" size="+1">let simpleTest =
Float(abs(11 - -3) + abs(4.5 - -4)) //!<br class="">
print ("simpleTest: \(Simpletest)")<br class="">
</font><font style="font-family: Helvetica; font-style:
normal; font-variant-caps: normal; font-weight: normal;
letter-spacing: normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none; white-space:
normal; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255,
255, 255);" class="" size="+1"><br class="">
</font></div>
</blockquote>
</div>
<br class="">
<div class="">
<div class="">Aside from the fact that the case-sensitivity of
simpleTest is important, the delay is in the compilation of
this script rather than the runtime performance of the script.
You can compile it with swiftc (which takes around 20s) but
then when running it the performance is fine.</div>
<div class=""><br class="">
</div>
<div class="">It's certainly an interesting compiler issue,
probably to do with the type analysis rather than the
complexity of the abs function or the Float cast directly.
It's still worth raising a bug at <a moz-do-not-send="true"
href="https://bugs.swift.org" class="">https://bugs.swift.org</a> with
the snippet though.</div>
<div class=""><br class="">
</div>
<div class="">Alex</div>
</div>
</blockquote>
<br>
</body>
</html>