Created attachment 743275 [details]
Revised primusrun script
This appears to yield the best performance, and it works reliably. It's
obviously a prototype, but it should indicate how to fix this bug.
The performance factors are PRIMUS_UPLOAD and PRIMUS_SLEEP. PRIMUS_UPLOAD has
a big effect; PRIMUS_SLEEP has a small but observable effect on performance.
In some cases optimus is faster; in others primus is. glxspheres runs about
50% faster under optimus (optirun) than under primus, but glmark2 gives about
30% overall better numbers under primus than under optimus. All of the glmark2
components appear to yield at least slightly better performance under primus
than optimus.