tornado icon indicating copy to clipboard operation
tornado copied to clipboard

WIP speedup

Open socketpair opened this issue 6 years ago • 3 comments

socketpair avatar Aug 28 '19 20:08 socketpair

@socketpair I don't know how to obtain a good benchmark on just the data xfer in the context of bokeh. I did a very simple thing and simply did a time diff between each send event on the bokeh server side after scrubbing the slider as fast as possible to the end and back. Under this simplistic scenario the PR version shows improvements:

#  PR
0.01871204376220703
0.03457999229431152
0.03917407989501953
0.0618898868560791
0.07506299018859863
0.08429718017578125
0.09840774536132812
0.11544418334960938
0.08565402030944824
0.06834793090820312
0.04084205627441406
0.024216175079345703
0.0087738037109375
0.0076751708984375
# without PR
0.054023027420043945
0.07475113868713379
0.07443594932556152
0.09787774085998535
0.11354708671569824
0.15288114547729492
0.16255998611450195
0.14158391952514648
0.08508515357971191
0.06563305854797363
0.03964400291442871
0.04157900810241699
0.03808784484863281
0.011606931686401367

I expect that the increasing times in this image blur example comes from the blur operation taking more time as the convolution mask size is increased. I will work on a more neutral example that does the same amount of compute on every update.

bryevdv avatar Sep 11 '19 05:09 bryevdv

@bryevdv I don't understand these numbers. Also, performance depends on presence of yield at left side of websocket.send_message() in Bokeh code. Without it, things will be faster, but it may eat too much memory because of buffering websocket messages.

socketpair avatar Sep 11 '19 08:09 socketpair

@socketpair sorry, I just ran a very rough (bad) test to time successive calls to the code that generates the buffer, with and without the PR. (And also using a memoryview with the PR) I was only trying to indicate that, absent any other changes, there seems to be improvement with this PR.

bryevdv avatar Sep 11 '19 15:09 bryevdv