dxos-deprecated / halo

HALO
GNU Affero General Public License v3.0
0 stars 1 forks source link

Credential message processing takes a long time in the browser #103

Open dmaretskyi opened 3 years ago

dmaretskyi commented 3 years ago

I’ve noticed that HALO might be causing long startup times in teamwork image each HALO message takes 150-300ms to process

Profiles:

Startup from snapshot: Profile-20201102T134100.json.zip

Joining party: invitation.json.zip

Slow functions

  1. validateSignature 19ms per call / 80 seconds spent in total

  2. get deviceKeyChain should be cached - 67ms per call / 700ms spent in total

  3. message selector is slow if there's even a single waiting halo message in candidates - as an optimization we should try verifying echo messages first and then the halo ones.

Invitation profiling

Wait time between redeeming an invitation and first feed starting replication - 20 seconds

dboreham commented 3 years ago

Reproduction steps:

  1. Open teamwork, create a new party, create a text document, add a small amount of text.
  2. Invite a new party member, redeem invitation in another browser window.
  3. Repeat the step above a total of 19 times.
  4. Reload page in browser.
  5. Measure time to reach quiescence.
dmaretskyi commented 3 years ago

Note: the browser window for the new member should be a separate browser context: either a different profile from all other members or a new incognito window

telackey commented 3 years ago

Before ( 75.4s ):

Old Code

After ( 4.5s ):

New Code