-
Notifications
You must be signed in to change notification settings - Fork 113
Don’t create an EventLoopFuture chain #4
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
Conversation
c0839ef
to
f24a9ce
Compare
Verified with instruments that memory is not increasing anymore. |
If we add an |
f24a9ce
to
0bd5415
Compare
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.
awesome find, some little comments
0bd5415
to
8b03533
Compare
8b03533
to
70e1647
Compare
@@ -89,7 +89,7 @@ class LambdaTest: XCTestCase { | |||
} | |||
let result = try future.wait() | |||
XCTAssertGreaterThan(result, 0, "should have stopped before any request made") | |||
XCTAssertLessThan(result, maxTimes, "should have stopped before \(maxTimes)") | |||
XCTAssertLessThanOrEqual(result, maxTimes, "should have stopped at \(maxTimes)") |
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.
better to change maxTimes to some larger number (1000) instead otherwise we loose the test value
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.
thanks for the fix, the XCTAssertLessThan should stay so we are testing we stopped before reaching maxTimes
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.
Oh. Sure that makes tons of sense.
3fa503f
to
33c7288
Compare
33c7288
to
8da62ce
Compare
motivation: prevent memory bloat changes: * recurse instead of event loop chain * fix flaky test
motivation: prevent memory bloat changes: * recurse instead of event loop chain * fix flaky test
motivation: prevent memory bloat changes: * recurse instead of event loop chain * fix flaky test
motivation: prevent memory bloat changes: * recurse instead of event loop chain * fix flaky test
motivation: prevent memory bloat changes: * recurse instead of event loop chain * fix flaky test
motivation: prevent memory bloat changes: * recurse instead of event loop chain * fix flaky test
Currently we build up an EventLoopFuture chain. This pr fixes this. Its performance (speed) though is a little slower than before. But I think not running into memory limits at this point outweighs the performance considerations.