simperby icon indicating copy to clipboard operation
simperby copied to clipboard

Optimize push operation by removing duplications

Open JeongHunP opened this issue 1 year ago • 0 comments

Currently, git push operation is executed by broadcast function inDistributedRepository module.
It is used to broadcast local changes to the remote repository, however, it is slow due to the repeated push operations. You can see how many push operations are executed when you run cli in cli/tests/e2e.rs or normal_1 in simperby/tests/integration_test.rs. As client nodes sync each other by broadcasting to the server node, they repeatedly push same local changes(agenda/agenda proof/block/fp branches). So, we should optimize the number of push operation by storing the past pushed branches like caches.

What you should do is

  1. Run above tests and see how many push operations are executed during making and syncing just one block.
  2. Introduce appropriate data structure to store the branches that pushed.
  3. Change broadcast in repository/interpret/push.rs by using the new data structure.
  4. Please check by running the same tests and see results.

Requirements

  1. New data structure to store the pushed branches are the member of DistributedRepository struct.
  2. As local branches which will be pushed are usually attached to the most recent block, it is better to flush(remove all) the content of storage as the block height increases.
  3. Each remembered branches should be stored each remote repositories.
  4. It stores commit hashes, not branch names.

JeongHunP avatar Aug 03 '23 13:08 JeongHunP