Skip to content

optimize - #12254

Merged
normanmaurer merged 1 commit into
netty:4.1from
coderbruis:optimize_bzip2blockcompressor
Apr 5, 2022
Merged

optimize#12254
normanmaurer merged 1 commit into
netty:4.1from
coderbruis:optimize_bzip2blockcompressor

Conversation

@coderbruis

@coderbruis coderbruis commented Mar 30, 2022 •

Copy link
Copy Markdown
Contributor

Motivation:

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

Result:

Small optimization

@chrisvest

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.

@coderbruis

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?

@chrisvest

Copy link
Copy Markdown
Member

@coderbruis

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.

@chrisvest

Copy link
Copy Markdown
Member

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

@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

Copy link
Copy Markdown
Member

@coderbruis thanks!

normanmaurer pushed a commit that referenced this pull request Apr 5, 2022
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
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
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants