-
Notifications
You must be signed in to change notification settings - Fork 448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add flags for expensive path algorithms #962
Conversation
just adding tests would be great, otherwise looks good! |
5155f11
to
6af7f89
Compare
6ac5c83
to
36dfc03
Compare
36dfc03
to
e944bff
Compare
expect(clonedModel).toBeInstanceOf(MyModel); | ||
}); | ||
|
||
describe('JSON-Graph Specification', function() { | ||
require('./get-core'); | ||
describe("algorithm options", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of testing all algorithm options together, i'd prefer them tested separately, just because we may have more algorithm-related options later which may not be orthogonal to each other in the way these two are.
i propose the following structure for the test hierarchy here:
describe('Model...
describe('disable path collapse algorithm'...
describe('disable request de-duplication'...
expect(queue._requests.length).toBe(2); | ||
expect(queue._requests[1].sent).toBe(true); | ||
expect(queue._requests[1].scheduled).toBe(false); | ||
|
||
disposable(); | ||
disposable2(); | ||
}); | ||
|
||
it("does not dedupe requests when it is disabled", done => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion:
... when request de-duplication is disabled by the model ...
queue.get([videos1, videos2], [videos1, videos2], zip); | ||
}); | ||
|
||
it("combines batched paths without collapse when it is disables", done => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: when path collapsing is disabled on the model
}); | ||
|
||
it("combines batched paths without collapse when it is disables", done => { | ||
const scheduler = new ASAPScheduler(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the relevance, if any, of ImmediateScheduler
vs ASAPScheduler
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- ImmediateScheduler: executes
flushGetRequest
synchronously, never batches (because they'll be marked 'sent' directly after the respectivemodel.get()
call) - ASAPScheduler: schedules fetches on the next tick, successive
model.get()
calls are batched
Other than the minor nitpicks I made, looks good! |
Added flags to disable request deduplication and path collapsing. These are expensive algorithms and we'd like to quantify their impact on users.