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

Suggestion about AcceleratedCRC32C() #488

Closed
wants to merge 1 commit into from
Closed

Suggestion about AcceleratedCRC32C() #488

wants to merge 1 commit into from

Conversation

VinceCui
Copy link

I think the Process(unaligned bytes) in function in file port_posix_sse.cc maybe wrong.
The original code does m times STEP1, where m = p%8.
If p=10,then m=2,and the new p will be equal to 12, which is not aligned by 8.
Thannks for reading.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@VinceCui
Copy link
Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@pwnall
Copy link
Member

pwnall commented Aug 15, 2017

Can you please submit a test that the original code fails, but your test passes? You can use the non-accelerated implementation to get a reference value.

@VinceCui
Copy link
Author

I know the original code can get the right result. However, the original code can’t do a right alignment work.
For example, when you use the original code, if p = 0x0003, then reinterpret_cast<uintptr_t>(p) % 8 will be 3. That means you should do 5 times STEP1 so that p will be added to 0x0008, which is aligned. But the original code will perform 3 times STEP1, which can just add p to 0x0006.
My suggestion will always let the p aligned to a multiple of 8, which is the purpose of that code.
Of course, the original code can get the right result because it just do a wrong alignment work, which makes the accelerate slow. As far as I know, the right alignment work can make the memory access faster.
Thanks for reading. May you have a good summer!

@pwnall
Copy link
Member

pwnall commented Aug 15, 2017

@VincentVessalius Thank you for explaining! The explanation makes sense, and a fix is on the way.

pwnall added a commit to pwnall/leveldb that referenced this pull request Aug 24, 2017
When faced with a pointer that is misaligned by K bytes (pointer % 8 ==
K), the code previously moved forward by K bytes. In order to end up
with an aligned pointer, the code must move by 8 - K bytes.

This lands google#488

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166295921
pwnall added a commit to pwnall/leveldb that referenced this pull request Aug 24, 2017
When faced with a pointer that is misaligned by K bytes (pointer % 8 ==
K), the code previously moved forward by K bytes. In order to end up
with an aligned pointer, the code must move by 8 - K bytes.

This lands google#488

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166295921
@pwnall
Copy link
Member

pwnall commented Aug 24, 2017

This landed in 2964b80. Thank you very much for your contribution!

@pwnall pwnall closed this Aug 24, 2017
maochongxin pushed a commit to maochongxin/leveldb that referenced this pull request Jul 21, 2022
…e#488)

As @dominichamon and I have discussed, the current reporter interface
is poor at best. And something should be done to fix it.

I strongly suspect such a fix will require an entire reimagining
of the API, and therefore breaking backwards compatibility fully.

For that reason we should start deprecating and removing parts
that we don't intend to replace. One of these parts, I argue,
is the CSVReporter. I propose that the new reporter interface
should choose a single output format (JSON) and traffic entirely
in that. If somebody really wanted to replace the functionality
of the CSVReporter they would do so as an external tool which
transforms the JSON.

For these reasons I propose deprecating the CSVReporter.
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