How slow is slow? There shouldn't be too large a discrepancy in my experience between the sketch and export versions. So, it could be another issue.
I've made a couple of very quick changes, but nothing that's going to greatly affect the speed of things.
The start flag isn't required if you chuck the initialization stuff into setup and the same goes for the mouse test stuff.
Code:
//set up variables
int NUM=20;
int[] x1 = new int[NUM];
int[] y1 = new int[NUM];
int[] x1old = new int[NUM];
int[] y1old = new int[NUM];
int x1new;
int y1new;
void setup() {
size (200,200);
for (int i=0; i<NUM; i++){
x1[i]=int(random(20,width-20));
y1[i]=int(random(5,height-5));
x1old[i]=x1[i];
y1old[i]=y1[i];
}
}
void draw() {
background(255);
//draw arrows
for(int i=0; i<NUM; i++) {
pushMatrix();
translate(x1[i],y1[i]);
rotate(radians(360)/NUM*i);
line(-20,0,0,0);
line(0,0,-5,-5);
line(0,0,-5,+5);
popMatrix();
}
//translate when mouse pressed
if (mousePressed) {
x1new=mouseX;
y1new=mouseY;
for (int i=0;i<NUM;i++) {
if (y1new>y1[i]) {
y1[i]++;
}
if (y1new<y1[i]) {
y1[i]--;
}
if (x1new>x1[i]) {
x1[i]++;
}
if (x1new<x1[i]) {
x1[i]--;
}
}
}
//snap back to position when mouse is relased *below* is triggered
else {
for (int i=0;i<NUM;i++) {
if (y1old[i]>y1[i]) {
y1[i]++;
}
if (y1old[i]<y1[i]) {
y1[i]--;
}
if (x1old[i]>x1[i]) {
x1[i]++;
}
if (x1old[i]<x1[i]) {
x1[i]--;
}
}
}
}
void mouseReleased() {
for (int i=0; i<NUM; i++){
x1old[i]=int(random(20,width-20));
y1old[i]=int(random(5,height-5));
}
}