[DEV-6968] Client: Hook classifier after initQuote
This saves a lot of time for large classifiers by waiting to invoke it until after some initial bucket setup has been done. In particular, initQuote. DelayedStagingBucket exists to try to limit the number of events that are kicked off. In this case, initQuote typically uses setCommittedValues, which DelayedStagingBucket does not override. However, overriding it did not provide a whole lot of benefit, since initQuote also calls getDataByName, which forces DelayedStagingBucket to flush so that hooks can run validations and such. The last step in Client#_changeQuote is to force the classifier to run, so this should be safe, unless calculated values happen to use classification results, in which case they'll be momentarily wrong and then immediately updated after the classifier runs.master
parent
671f7cc6cb
commit
1aa51775f3
|
@ -507,8 +507,6 @@ module.exports = Class( 'Client' )
|
|||
|
||||
client._monitorQuote( client._quote );
|
||||
|
||||
client._cmatch.hookClassifier( client._dataValidator );
|
||||
|
||||
// store internal status
|
||||
client._isInternal = client.program.isInternal =
|
||||
( data.content.internal )
|
||||
|
@ -528,6 +526,8 @@ module.exports = Class( 'Client' )
|
|||
client.program.initQuote( bucket );
|
||||
} );
|
||||
|
||||
client._cmatch.hookClassifier( client._dataValidator );
|
||||
|
||||
client.ui.setQuote( client._quote, client.program, clear_step );
|
||||
|
||||
// if logged in internally, show internal questions and do other
|
||||
|
|
Loading…
Reference in New Issue