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

Byte alignment, optimization from 96 to 80 byte #865

Merged
merged 2 commits into from Dec 11, 2020
Merged

Conversation

@wziww
Copy link
Contributor

@wziww wziww commented Sep 18, 2020

Optimization Logger struct

@CLAassistant
Copy link

@CLAassistant CLAassistant commented Sep 18, 2020

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@prashantv prashantv left a comment

Thank you for the contribution @wziww

The change is correct, but it has some unnecessary reordering. For example, there's no advantage in moving core to not be the first field, and having it there is a little cleaner.

The main improvement is from grouping the bool types + the CheckWriteAction, no need to reorder the zapcore.Core.

@wziww
Copy link
Contributor Author

@wziww wziww commented Oct 9, 2020

Thank you for the contribution @wziww

The change is correct, but it has some unnecessary reordering. For example, there's no advantage in moving core to not be the first field, and having it there is a little cleaner.

The main improvement is from grouping the bool types + the CheckWriteAction, no need to reorder the zapcore.Core.

Yeah you right.

@codecov
Copy link

@codecov codecov bot commented Oct 9, 2020

Codecov Report

Merging #865 into master will decrease coverage by 0.15%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #865      +/-   ##
==========================================
- Coverage   98.36%   98.21%   -0.16%     
==========================================
  Files          43       43              
  Lines        2390     1904     -486     
==========================================
- Hits         2351     1870     -481     
+ Misses         32       27       -5     
  Partials        7        7              
Impacted Files Coverage Δ
logger.go 96.15% <ø> (+0.84%) ⬆️
internal/ztest/timeout.go 81.81% <0.00%> (-4.85%) ⬇️
zapcore/write_syncer.go 87.50% <0.00%> (-2.98%) ⬇️
internal/exit/exit.go 90.90% <0.00%> (-2.85%) ⬇️
zapcore/encoder.go 87.09% <0.00%> (-1.14%) ⬇️
zapcore/core.go 93.54% <0.00%> (-1.05%) ⬇️
zapcore/entry.go 93.82% <0.00%> (-0.80%) ⬇️
stacktrace.go 96.00% <0.00%> (-0.56%) ⬇️
global.go 96.66% <0.00%> (-0.48%) ⬇️
flag.go 100.00% <0.00%> (ø)
... and 34 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 404189c...a3911a3. Read the comment docs.

@rabbbit
Copy link

@rabbbit rabbbit commented Oct 9, 2020

Is there an easy/automated way you were aligning this, or is it just manual checking? :)

@wziww
Copy link
Contributor Author

@wziww wziww commented Oct 10, 2020

Is there an easy/automated way you were aligning this, or is it just manual checking? :)

I do think manual checking is the best, try to form a habit while coding.
But we can also use reflect to build some small tools to check it.

@abhinav
abhinav approved these changes Dec 9, 2020
@prashantv prashantv merged commit f5a3592 into uber-go:master Dec 11, 2020
4 checks passed
4 checks passed
@travis-ci
Travis CI - Pull Request Build Passed
Details
@codecov
codecov/patch Coverage not affected when comparing 404189c...a3911a3
Details
@codecov
codecov/project 98.21% (target 95.00%)
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants