Skip to content
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

Limit output size #108

Merged
merged 6 commits into from
Mar 31, 2017
Merged

Limit output size #108

merged 6 commits into from
Mar 31, 2017

Conversation

boulter
Copy link
Contributor

@boulter boulter commented Mar 30, 2017

Adds a configuration option to limit the maximum size of an output node.

@jmagnarelli-hs

private long maxOutputSize;

public OutputList(long maxOutputSize) {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: why the extra line here?


public void addNode(OutputNode node) {

if (maxOutputSize > 0 && node.getSize() > maxOutputSize) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this only check the size of this node against the max? What if we're adding a large number of very small nodes? Just pushed a test that shows what I mean.

If this is only intended to limit the size of individual nodes, I think we should change the name of maxOutputSize to something else.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be fixed now

boulter and others added 2 commits March 31, 2017 13:09
Previously I was only checking size as we rendered individual output
nodes. This helped prevent any one node from getting too big and short
circuiting the render, but it was possible to have output that was too
big when adding up the output nodes and rendered blocks.
@boulter boulter merged commit eb48d61 into master Mar 31, 2017
@boulter boulter deleted the limit-output-size branch March 31, 2017 19:20
@jmagnarelli-hs
Copy link
Contributor

🍹

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants