opened 11:04PM - 26 Jul 16 UTC
type: discussion
tag: webgl
Code to reproduce:
``` python
import numpy as np
from bokeh.plotting import out…put_file, show, figure
output_file('line.html')
webgl = True
plot = figure(title='WebGL = {}'.format(webgl), webgl=webgl)
for i in range(50):
data = np.random.rand(2,10)
plot.line(x=data[0], y=data[1])
show(plot)
```
It appears that drawing many Line glyphs (very noticeable above 50) with webgl=True causes poor rendering performance (~5 second page render). Using the Chrome profiler dev tool, it appears that many CPU cycles are spent inside of core webgl calls (`getProgramParameter` and `getShaderParameter`).
<img width="1434" alt="screen shot 2016-07-26 at 5 56 31 pm" src="https://cloud.githubusercontent.com/assets/2198981/17158273/d8a4da8a-535a-11e6-9612-e29fab0eb3a8.png">
Here's the profiler output with webgl disabled:
<img width="1437" alt="screen shot 2016-07-26 at 5 56 44 pm" src="https://cloud.githubusercontent.com/assets/2198981/17158282/e7843460-535a-11e6-86ac-40701f1c7ddc.png">
It's worth discussing if these webgl calls could potentially be aggregated into fewer calls or cached.