initial perf, which gets stripped out in production (#4131)
This commit is contained in:
@@ -104,6 +104,10 @@ export const resolveSpec = (json, url) => ({specActions, specSelectors, errActio
|
||||
|
||||
let specStr = specSelectors.specStr()
|
||||
|
||||
/* develblock:start */
|
||||
require("root/src/perf").start("resolve")
|
||||
/* develblock:end */
|
||||
|
||||
return resolve({
|
||||
fetch,
|
||||
spec: json,
|
||||
@@ -131,6 +135,9 @@ export const resolveSpec = (json, url) => ({specActions, specSelectors, errActio
|
||||
errActions.newThrownErrBatch(preparedErrors)
|
||||
}
|
||||
|
||||
/* develblock:start */
|
||||
require("root/src/perf").stop("resolve")
|
||||
/* develblock:end */
|
||||
return specActions.updateResolved(spec)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -42,7 +42,15 @@ export default {
|
||||
},
|
||||
|
||||
[UPDATE_RESOLVED]: (state, action) => {
|
||||
return state.setIn(["resolved"], fromJSOrdered(action.payload))
|
||||
/* develblock:start */
|
||||
require("root/src/perf").start("UPDATE_RESOLVED")
|
||||
/* develblock:end */
|
||||
const resolved = fromJSOrdered(action.payload)
|
||||
|
||||
/* develblock:start */
|
||||
require("root/src/perf").stop("UPDATE_RESOLVED")
|
||||
/* develblock:end */
|
||||
return state.setIn(["resolved"], resolved)
|
||||
},
|
||||
|
||||
[UPDATE_RESOLVED_SUBTREE]: (state, action) => {
|
||||
|
||||
@@ -15,9 +15,15 @@ const idFn = a => a
|
||||
function createStoreWithMiddleware(rootReducer, initialState, getSystem) {
|
||||
|
||||
let middlwares = [
|
||||
// createLogger( {
|
||||
// stateTransformer: state => state && state.toJS()
|
||||
// } ),
|
||||
/* develblock:start */
|
||||
// Measure actions
|
||||
() => next => action => {
|
||||
require("root/src/perf").start("action:"+action.type)
|
||||
const res = next(action)
|
||||
require("root/src/perf").stop("action:"+action.type)
|
||||
return res
|
||||
},
|
||||
/* develblock:end */
|
||||
systemThunkMiddleware( getSystem )
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user