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

Add GzipConfig.compressionLevel #8059

Merged
merged 3 commits into from
Dec 24, 2017
Merged

Add GzipConfig.compressionLevel #8059

merged 3 commits into from
Dec 24, 2017

Conversation

jxtps
Copy link
Contributor

@jxtps jxtps commented Dec 1, 2017

Allow user to specify the compression level to use for the underlying Deflater instance, and switch the default compression level from Deflater.BEST_COMPRESSION to Deflater.DEFAULT_COMPRESSION.

Mailing list discussion: https://groups.google.com/d/topic/play-framework/xjgcXPsRvyo/discussion

In a not very scientific microbenchmark where I compress a 600kb webpage 100x for each compression level I got the following (on the second run so things have had a chance to JIT):

[info] application - Level 1: 619,883 -> 111,773, 18.03130590772775%, nanos: 531,628,867, 11177300
[info] application - Level 2: 619,883 -> 87,209, 14.068622627173193%, nanos: 549,247,847, 8720900
[info] application - Level 3: 619,883 -> 94,679, 15.27368874448888%, nanos: 731,691,153, 9467900
[info] application - Level 4: 619,883 -> 84,454, 13.624183918578183%, nanos: 804,356,176, 8445400
[info] application - Level 5: 619,883 -> 81,712, 13.181842379932988%, nanos: 1,152,557,312, 8171200
[info] application - Level 6: 619,883 -> 57,972, 9.352087410043508%, nanos: 1,826,056,529, 5797200
[info] application - Level 7: 619,883 -> 58,539, 9.443556284008434%, nanos: 2,679,872,317, 5853900
[info] application - Level 8: 619,883 -> 56,608, 9.132045886078503%, nanos: 8,115,200,116, 5660800
[info] application - Level 9: 619,883 -> 56,413, 9.100588336831306%, nanos: 11,152,594,021, 5641300

Deflater.DEFAULT_COMPRESSION = -1 but corresponds to 6 in actual usage.

@jxtps
Copy link
Contributor Author

jxtps commented Dec 5, 2017

Looks like the builds failed for some weird reasons that appear mostly unrelated to the changes in this PR, with the exception of:

[error] * method gzip(Int)akka.stream.scaladsl.Flow in object play.api.libs.streams.GzipFlow does not have a correspondent in current version
[error] filter with: ProblemFilters.excludeDirectMissingMethodProblem

And yes, the change isn't binary compatible, but it's source compatible - is that not enough?

@PromanSEW
Copy link
Contributor

@jxtps maybe you should add exclusion rule to MiMa config to solve this compatibility problem

@jxtps
Copy link
Contributor Author

jxtps commented Dec 5, 2017

I am not familiar with the MiMa config - what is that? Any chance you could make the change and we can get this merged? Thanks!

Copy link
Member

@gmethvin gmethvin left a comment

Choose a reason for hiding this comment

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

@jxtps If you add changes that break compatibility, you must add the relevant exclusion rules here: https://github.com/playframework/playframework/blob/master/framework/project/BuildSettings.scala#L172. The mimaReportBinaryIssues task gives you what you need to add: https://travis-ci.org/playframework/playframework/jobs/309864032#L970

The reason for this is to document the changes we've added and for what reason, so we can report which APIs are incompatible in Play 2.7.

@jxtps
Copy link
Contributor Author

jxtps commented Dec 6, 2017

Ok, I added the exclusions. Assuming that does the trick, I guess this is the part where you ask me to squash the commits? ;)

@marcospereira
Copy link
Member

Thanks for that, @jxtps.

There is still a missing compatibility issue that needs a filter: https://travis-ci.org/playframework/playframework/jobs/312175914#L535-L536

@jxtps
Copy link
Contributor Author

jxtps commented Dec 7, 2017

Added.

@mkurz
Copy link
Member

mkurz commented Dec 19, 2017

@jxtps "This branch has conflicts that must be resolved" - can you please rebase against latest master branch? Thanks!

Jacob86739375 added 3 commits December 19, 2017 15:22
Allow user to specify the compression level to use for the underlying
Deflater instance.
Add BuildSettings exclusions to document the interface changes.
play.api.libs.streams.GzipFlow.gzip needed an exclusion.
@jxtps
Copy link
Contributor Author

jxtps commented Dec 20, 2017

Rebased.

@gmethvin gmethvin merged commit a74bf43 into playframework:master Dec 24, 2017
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.

5 participants