Bokeh is slower at each iteration

Thanks everyone. I recently came across same exact issue in Bokeh 0.12.4, Spyder 3.1.2/Ipython 5.1.0.

bokeh.io.reset_output() did the trick.

From 2MB+ HTML file back down to 39kb :slight_smile:

Thanks for making this thread & pointing this bug out.

···

On Monday, July 11, 2016 at 1:46:45 PM UTC-7, Romain Jouin wrote:

Hi,

I am using jupyter notebook to make a bokeh map.

Each time I re-do my cell, the calculation time is longer.

Here is the idea of my map : I do a four-step map :

total_times =
import time

p = figure()

n_row = 100000

output_file(“france_zdc_et_unites.html”)

d = time.time()

glyph = p.patches(source =ColumnDataSource(france_hors_zdc[:n_row]), xs = “lat”, ys = “lng”, fill_color=“white”,line_color=“white”)
p.add_tools(HoverTool(renderers=[glyph], tooltips=[(“cp”, “@cp”)], name=“hors_zdc”))

source = ColumnDataSource(nb_unite_by_cp[[‘lat’, ‘lng’,‘cp_y’, ‘unite’, ‘unites’, ‘color’]][:n_row])
glyph = p.patches(source =source, xs = “lat”, ys = “lng”, fill_color=“color”,)

p.add_tools(HoverTool(renderers=[glyph], tooltips=[(“cp”, “@cp_y”), (“nb unite”, “@unite”), (“liste unites”, “@unites”)], name=“zdc”))

source =ColumnDataSource(unite_hors_zdc[[u’unit’, u’pool’, u’X_lambert93’, u’Y_Lambert93’]][:n_row])

glyph = p.circle(source =source , x = u’X_lambert93’, y = u’Y_Lambert93’, color=“red”)

p.add_tools(HoverTool(renderers=[glyph], tooltips=[(“pool”, “@pool”), (“unite”, “@unit”)], name=“pool_units”))

source = ColumnDataSource(unite_dans_zdc[[u’unit’, u’pool’, u’X_lambert93’, u’Y_Lambert93’]][:n_row])

glyph = p.circle(source=source, x = u’X_lambert93’, y = u’Y_Lambert93’, color=“orange”)

p.add_tools(HoverTool(renderers=[glyph], tooltips=[(“pool”, “@pool”), (“unite”, “@unit”)], name=“pool_units”))

show(p)

d5 = time.time()

total_times.append(d5-d)

print total_times

``

The total time get each time bigger :

First iteration was about 10 sec, then after 3 or 4 I get : [29.3, 35.6, 42.9 ]

The size of the created html is also getting bigger and bigger : [26,7 Mo, 33,4 Mo 40,1Mo]

I tried to do a “del p” , it didn’t change anything

My activity monitor also tell me the python process is getting bigger at each iteration.

Anyone else has had the same issue ?

Is it a known issue ?

Any idea of a solution ?

Thx,

romain.