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

Check the level before writing debug messages. #253

Merged
merged 1 commit into from
Oct 5, 2021
Merged

Conversation

hackerwins
Copy link
Member

@hackerwins hackerwins commented Oct 4, 2021

What this PR does / why we need it:

Check the level before writing debug messages.

Performance was dropping to generate unnecessary debug messages. To avoid this, check the level before outputting a debug message.

goos: darwin
goarch: amd64
pkg: github.com/yorkie-team/yorkie/test/bench
cpu: Intel(R) Core(TM) i5-4690 CPU @ 3.50GHz
BenchmarkTextEditing
    text_editing_bench_test.go:59: processing... 10000 174.504879ms
    text_editing_bench_test.go:59: processing... 20000 109.470337ms
    text_editing_bench_test.go:59: processing... 30000 4.806405038s
    text_editing_bench_test.go:59: processing... 40000 216.480363ms
    text_editing_bench_test.go:59: processing... 50000 112.252058ms
    text_editing_bench_test.go:59: processing... 60000 808.748392ms
    text_editing_bench_test.go:59: processing... 70000 667.073535ms
    text_editing_bench_test.go:59: processing... 80000 9.17087822s
    text_editing_bench_test.go:59: processing... 90000 2.180935603s
    text_editing_bench_test.go:59: processing... 100000 1.731117444s
    text_editing_bench_test.go:59: processing... 110000 1.056575369s
    text_editing_bench_test.go:59: processing... 120000 124.693308ms
    text_editing_bench_test.go:59: processing... 130000 513.933027ms
    text_editing_bench_test.go:59: processing... 140000 54.806386806s
    text_editing_bench_test.go:59: processing... 150000 1m54.853097078s
    text_editing_bench_test.go:59: processing... 160000 1.055604723s
    text_editing_bench_test.go:59: processing... 170000 941.902282ms
    text_editing_bench_test.go:59: processing... 180000 15.575431116s
    text_editing_bench_test.go:59: processing... 190000 1.674996829s
    text_editing_bench_test.go:59: processing... 200000 15.967675598s
    text_editing_bench_test.go:59: processing... 210000 224.987399ms
    text_editing_bench_test.go:59: processing... 220000 154.559864ms
    text_editing_bench_test.go:59: processing... 230000 155.082594ms
    text_editing_bench_test.go:59: processing... 240000 1.347651533s
    text_editing_bench_test.go:59: processing... 250000 4.099265955s
BenchmarkTextEditing-4   	       1	240883800421 ns/op

Which issue(s) this PR fixes:

Address #251

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Additional documentation:


Checklist:

  • Added relevant tests or not required
  • Didn't break anything

@hackerwins hackerwins requested review from a team and zeikar October 4, 2021 18:53
@codecov
Copy link

codecov bot commented Oct 4, 2021

Codecov Report

Merging #253 (8ff9d60) into main (23677db) will decrease coverage by 1.54%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #253      +/-   ##
==========================================
- Coverage   51.41%   49.87%   -1.55%     
==========================================
  Files          54       54              
  Lines        4403     4417      +14     
==========================================
- Hits         2264     2203      -61     
- Misses       1932     1997      +65     
- Partials      207      217      +10     
Impacted Files Coverage Δ
pkg/document/document.go 51.47% <0.00%> (-0.77%) ⬇️
pkg/document/internal_document.go 21.66% <0.00%> (-0.37%) ⬇️
pkg/document/json/rich_text.go 51.02% <0.00%> (-13.20%) ⬇️
pkg/document/json/text.go 42.46% <0.00%> (-9.65%) ⬇️
yorkie/backend/sync/memory/pubsub.go 48.35% <0.00%> (-37.37%) ⬇️
pkg/document/json/rga_tree_split.go 73.42% <0.00%> (-7.21%) ⬇️

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 23677db...8ff9d60. Read the comment docs.

Copy link
Contributor

@zeikar zeikar left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@hackerwins hackerwins merged commit 3a3ee81 into main Oct 5, 2021
@hackerwins hackerwins deleted the wrap-debugf branch October 5, 2021 02:38
@hackerwins hackerwins added the hacktoberfest-accepted Accept for hacktoberfest, will merge later label Oct 5, 2021
jeonjonghyeok pushed a commit to jeonjonghyeok/yorkie that referenced this pull request Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Accept for hacktoberfest, will merge later
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants