Performance: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
mNo edit summary
Line 16: Line 16:


=== Compilers ===
=== Compilers ===
- [https://snakeisland.com/ Snake Island Research]
* [https://snakeisland.com/ Snake Island Research]


== References ==
== References ==
<references />
<references />

Revision as of 19:28, 19 February 2020

As an interpreted language, some have lambasted APL as unreasonably slow compared to other languages. However, much work has been done to ensure that interpreted code from a typical user is reasonably performant. Since its first implementation, work has been done on compiling APL.

Performant usage

For the user, there are a few strategies to consider for reasonable performance.

Mechanical sympathy

Internally, APL arrays are stored as two lists in memory. The first is a list of the shape (although some implementations also include the "stride"[1]). The second is the ravel of elements in the array. Nested arrays consist of pointers to arrays which may be distributed across memory, their use can lead to very inefficient memory read patterns - in contrast to flat arrays which are stored as a contiguous block. This idea is also explored in the study of inverted tables[2].

Performant implementation

For now enjoy a list of references.

Interpreters

Writing

Roger Hui; In Praise of Magic Functions; Dyalog Blog

Video

Morten Kromberg, Roger Hui; Primitive Performance; Dyalog '13 User Meeting

Compilers

References

  1. Nick Nickolov Compiling APL to JavaScript (Vector Volume 26)
  2. Roger Hui Inverted Tables (Dyalog '18 User Meeting)