Skip to content

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