at_server icon indicating copy to clipboard operation
at_server copied to clipboard

Refactor AtCommitLog

Open sitaram-kalluri opened this issue 1 year ago • 3 comments

Rework the AtCommitLog and CommitLogKeyStore to segregate client and server-specific functionalities.

Within commit_log_keystore.dart, introduce a new abstract class named "BaseCommitLogKeyStore." This class should implement HiveBase and contain methods that are common between the client and server. Subsequently, transform the CommitLogKeyStore to extend "BaseCommitLogKeyStore" instead of implementing HiveBase, now containing server-specific methods. Simultaneously, introduce a new class called "ClientCommitLogKeyStore," extending "CommitLogKeyStore," to house client-specific methods.

  • [x] Design and code changes
  • [x] Unit and functional test
  • [x] Raise PR
  • [x] Address PR review comments
  • [ ] Merge and publish the changes

sitaram-kalluri avatar Sep 05 '23 05:09 sitaram-kalluri

Work done in PR-72:

  • Implement CommitChange method.
  • Refactored removeNullCommitEntries
  • Refactored removeMalformedCommitEntries
  • Started in the bench marking the performance.

sitaram-kalluri avatar Oct 16 '23 09:10 sitaram-kalluri

Work done in PR-73:

  • Spent 8 SP in PR-73
  • Moved the commit log to Lazy box. The changes are available in lazy_commit_log_changes.
  • @purnimavenkatasubbu started testing the changes and found issue in at_server and at_client and the issues are fixed the changes are pushed.

Pending issue in PR-74

  • Retest the changes and raise a PR.

sitaram-kalluri avatar Oct 30 '23 13:10 sitaram-kalluri

Re-tested the changes, Previously reported issues are fixed. Comparison between the time taken for sync with trunk and this branch

The observation is sync is taking considerably longer time as the commits increase. For example

  1. For just 1000 commits, The Initial sync takes 6 seconds to complete
  2. For 10000 commits, the time to sync for the first 1000 keys is 1 minute 45 seconds
  3. For 30000 commits, the time to sync for the first 1000 keys is around 3 minutes

trunk branch

1)For just 1000 commits, The Initial sync takes 7 seconds 2) For 10000 commits, the time taken for the first 1000 keys is 7 seconds 3) For 30000 commits, the time taken for the first 1000 keys is 7 seconds

purnimavenkatasubbu avatar Nov 27 '23 05:11 purnimavenkatasubbu