Skip to content

Commit

Permalink
don't deep clone of ddata when making a sandbox since it's slow
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoncalabrese committed Dec 26, 2015
1 parent 868cc10 commit 9f5aa3b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/client/index.js
Expand Up @@ -317,15 +317,20 @@ client.init = function init(serverSettings, plugins) {

function updatePlugins (sgvs, time) {

var ddata = client.ddata.clone();
ddata.sgvs = sgvs; //TODO stop sending split sgvs
ddata.inRetroMode = inRetroMode();
ddata.profile = profile;
//TODO: doing a clone was slow, but ok to let plugins muck with data?
//var ddata = client.ddata.clone();

//TODO: stop sending split/processed sgvs
//TODO: this is wiping out the pure data, but same as before
client.ddata.sgvs = sgvs;

client.ddata.inRetroMode = inRetroMode();
client.ddata.profile = profile;

client.sbx = sandbox.clientInit(
client.ctx
, new Date(time).getTime() //make sure we send a timestamp
, ddata
, client.ddata
);

//all enabled plugins get a chance to set properties, even if they aren't shown
Expand Down

0 comments on commit 9f5aa3b

Please sign in to comment.