Make sure that canvasx and canvasy properties are initialized from the start (#896)
authorJohn Fremlin <john@fremlin.org>
Sun, 31 Dec 2017 18:32:36 +0000 (13:32 -0500)
committerDan Vanderkam <danvdk@gmail.com>
Sun, 31 Dec 2017 18:32:36 +0000 (13:32 -0500)
commit61767ef761b66b06e089cd081ac68527575af38b
tree62f1c4e036b26fd0085e3bdb4413b92cb4621980
parentac422b3aa23612c220b14e938fbae79d01b40b86
Make sure that canvasx and canvasy properties are initialized from the start (#896)

Adding fields to a structure after it is created can be slow on some
browsers, like Chrome.

Adding a demo to benchmark many points, this seems to speed up my
Chromium from about 2.8-3s to about 1.8s.

Thanks to Christopher Palmer (@thecav) for the analysis and specific
suggestion.
gallery/data.js
gallery/index.html
gallery/many-points.js [new file with mode: 0644]
src/datahandler/datahandler.js