# Performance

There are three methods for increasing performance:

- Replacing dynamic arrays with dimensioned arrays

- Replacing common with named common

- Saving screen images in a variable

Replacing dynamic arrays with dimensioned arrays is especially
effective when an item is read from a file and extensively
manipulated afterwards. If the number of attributes in the item is
known, the matread
statement can be used to read the dynamic string into a dimensioned
array. If the size is not known or subject to change, read the item
into a dynamic array and use the dcount
function to get the number of attributes, redimension a dimensioned
array to the desired size, and assign the dynamic array to the
dimensioned array. For example:

```
equam to char(254)
readxx from "big.item"
size= dcount(xx,am)
dimstat(size)
stat= xx
```
Another way to increase speed is using named commons to store
data that must be used between various applications. If named
commons are used for this purpose, all applications involved must
be compiled with either the interpreter or with FlashBASIC.

If an application performs large amounts of screen output, it is
suggested that screens be built as large strings at the beginning
of the program. This way, a screen refresh prints the string
variable.

```
x=@(-1):@(1,1):"Name:":@(1,2):"Number:":@(1,3)
:"Address:"
printx
```

---
Source: https://d3codex.com/pickbasic-flashbasic/performance/ - part of the D3Codex reference.
