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

Find the cause of the linear increase in text benchmark execution time #251

Closed
hackerwins opened this issue Oct 3, 2021 · 2 comments
Closed
Assignees
Labels
enhancement 🌟 New feature or request good first issue 🐤 Good for newcomers

Comments

@hackerwins
Copy link
Member

hackerwins commented Oct 3, 2021

Description:

At #246 we introduced benchmark tests.

However, it was not possible to complete the 250,000 text benchmark test. If we check the execution time for each section by 1000, we can see that it increases linearly.

    editing_bench_test.go:86: processing... 1000 833.432413ms
    editing_bench_test.go:86: processing... 2000 2.486363836s
    editing_bench_test.go:86: processing... 3000 3.766670666s
    editing_bench_test.go:86: processing... 4000 5.264808552s
    editing_bench_test.go:86: processing... 5000 7.45837556s
    ...

We need to use the profiler to see what is causing the execution speed to increase.

We can check performance bottlenecks in the browser with the following command:

$ make bench
$ go tool pprof ./test/bench/text-editing.prof
(pprof) web

Why:

  • We can improve the running speed of Yorkie Text or Document.
@hackerwins
Copy link
Member Author

In addition, Ticket.Key is a function that is called very frequently, so I think we should find a way to replace fmt.Sprintf.

Screen Shot 2021-10-05 at 3 57 38 AM

@hackerwins
Copy link
Member Author

Now it seems to be somewhat resolved, so I'll close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🌟 New feature or request good first issue 🐤 Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants