[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] Some Crypto

From: Elias Mårtenson
Subject: Re: [Bug-apl] Some Crypto
Date: Thu, 10 Sep 2015 23:45:27 +0800

Again close to half of the time is spent copying arrays prior to alteration, but I've discussed this at length already.

Now, there is a way to improve the performance of the array copying. I think there might be an opportunity to shave some 20% off the execution time by implementing support for pure arrays (i.e. depth-1 arrays where all cells are the same type. This is because there are virtual calls on the Values in the array that is being dispatched on, once per cell. For pure arrays, the type can be checked once at the beginning, the elements downcasted using reinterpret_cast<>, which will avoid the virtual call.

I'm thinking that this could possibly be done simply by having an extra type indicator in the array class, that indicates if the array is pure, and if so, what type it contains.



On 10 September 2015 at 22:13, Mike Duvos <address@hidden> wrote:
The attached transfer file contains an implementation of the SHA-256 message digest function, described in FIPS 180-4, as a collection of APL objects.  This is an excellent test of doing large numbers of single-bit operations in APL.

The function HASH computes the message digest of a character string using SHA-256, and returns the result as a lower case hexadecimal character string.

      HASH 'The Magic Words are Squeamish Ossifrage'

We can hash something a bit longer, and time it, first in APL2 on my Dell Dimension 2400.


      TIME 'HASH 10000⍴''X'''
2.797 Seconds.

And next in GNU APL on my Amazon instance of Ubuntu Server, again with instrumentation disabled.


      TIME 'HASH 10000⍴''X'''
2.481 Seconds.

So this is another example of a calculation where GNU APL is quite competitive with IBM's APL2 product.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]