GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — optimize by coderbruis · Pull Request #12254 · netty/netty

Conversation

@coderbruis

@coderbruis coderbruis commented Mar 30, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Motivation:

There is no need to finish inner loop when condensedInUse[i] setting as true.

Result:

Small optimization

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@coderbruis
optimize
47c79cf
@chrisvest

chrisvest commented Mar 31, 2022

Copy link
Copy Markdown
Member

Bzip2 is not very widely used, I think, and it's also slower than more modern alternatives like lz4 and zstd.
Given that, and since this changes the binary output of the algorithm, I don't think this is something we want to do.
It's too much work to convince ourselves that this doesn't break something.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderbruis

coderbruis commented Apr 1, 2022

Copy link
Copy Markdown
Contributor Author

Bzip2 is not very widely used, I think, and it's also slower than more modern alternatives like lz4 and zstd. Given that, and since this changes the binary output of the algorithm, I don't think this is something we want to do. It's too much work to convince ourselves that this doesn't break something.

Are you meaning the code submitted by me changed the output result of the algorithm?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chrisvest

chrisvest commented Apr 1, 2022

Copy link
Copy Markdown
Member

Yeah, the output depends on the values in condensedInUse here: https://github.com/netty/netty/blob/4.1/codec/src/main/java/io/netty/handler/codec/compression/Bzip2BlockCompressor.java#L122-L132

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderbruis

coderbruis commented Apr 1, 2022

Copy link
Copy Markdown
Contributor Author

Yeah, the output depends on the values in condensedInUse here: https://github.com/netty/netty/blob/4.1/codec/src/main/java/io/netty/handler/codec/compression/Bzip2BlockCompressor.java#L122-L132

But the code submitted by me just break the inner loop when condensedInUse[i] set as true, and then continue the outter loop. I mean that it doesn't change the values of the condensedInUs, so I can't understand why the output will be changed? I guess the code submitted was folded, you read the imcomplete code.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chrisvest

chrisvest commented Apr 1, 2022

Copy link
Copy Markdown
Member

Ah, right, it's the j iterating loop that breaks, not the i loop.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chrisvest
chrisvest approved these changes Apr 1, 2022
View reviewed changes
@normanmaurer
normanmaurer merged commit 5e23212 into netty:4.1 Apr 5, 2022
@normanmaurer normanmaurer added this to the 4.1.76.Final milestone Apr 5, 2022
@normanmaurer

normanmaurer commented Apr 5, 2022

Copy link
Copy Markdown
Member

@coderbruis thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

normanmaurer pushed a commit that referenced this pull request Apr 5, 2022
@coderbruis @normanmaurer
Break loop early if possible (#12254)
d25a757
Motivation:

There is no need to finish inner loop when condensedInUse[i] setting as true.

Result:

Small optimization
raidyue pushed a commit to raidyue/netty that referenced this pull request Jul 8, 2022
@coderbruis 夏无影
Break loop early if possible (netty#12254)
e8b6215
Motivation:

There is no need to finish inner loop when condensedInUse[i] setting as true.

Result:

Small optimization
franz1981 pushed a commit to franz1981/netty that referenced this pull request Aug 22, 2022
@coderbruis @franz1981
Break loop early if possible (netty#12254)
88834f0
Motivation:

There is no need to finish inner loop when condensedInUse[i] setting as true.

Result:

Small optimization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chrisvest chrisvest chrisvest approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

4.1.76.Final

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@coderbruis @chrisvest @normanmaurer
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.