|
From: | Juergen Sauermann |
Subject: | Re: [Bug-apl] Performance problem with simple program |
Date: | Wed, 07 Oct 2015 13:27:19 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
Hi Elias, using ⍎ in an inner loop is almost certainly a mistake. In your example ⍎ is evaluated 202287 times. That means we have less than 5 micro-seconds for tokenising, parsing, and executing the left argument of ⍎ and for producing it. That does not sound that slow. In the 70s and 80's APL programmers were aware that ⍎ was inherently slow (due to the many things happening under the hood) and did their best to avoid it. These days I see more and more examples on the web where ⍎ is used, and often without a real need to do so. Often APL programs look slighly more elegant when ⍎ is used, but the speed penalty for doing so is considerable (and un-avoidable). For the sake of APL I would hope that such examples will disappear. /// Jürgen On 10/06/2015 07:32 AM, Elias Mårtenson
wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |