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

*: Add file meta cache to avoid resolve log time #26

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

crazycs520
Copy link
Collaborator

@crazycs520 crazycs520 commented Dec 7, 2020

When there are 1000 tidb.log files, the function resolveFiles will cost much time to read the file start time and the file end time. This PR add a meta cache to avoid resolve log file time.

Here is a benchmark when there are 1000 tidb.log files.

Before

search_log_test.go:670: searchLogSuite.BenchmarkResolveFiles            50          40212549 ns/op

This PR:

searchLogSuite.BenchmarkResolveFiles           100          18780837 ns/op

This cache has also been used in pingcap/tidb#21536.

Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
@crazycs520
Copy link
Collaborator Author

/rebuild

Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
Signed-off-by: crazycs520 <[email protected]>
This reverts commit 2c5a418.
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.

1 participant