Page MenuHomePhabricator

[keyserver] Use async version of brotliCompress
ClosedPublic

Authored by ashoat on Sep 26 2023, 1:08 PM.
Tags
None
Referenced Files
F2773929: D9298.id31432.diff
Fri, Sep 20, 2:47 AM
F2773866: D9298.id31429.diff
Fri, Sep 20, 2:46 AM
F2773484: D9298.id31428.diff
Fri, Sep 20, 2:22 AM
Unknown Object (File)
Sun, Sep 15, 1:14 PM
Unknown Object (File)
Sun, Sep 15, 1:14 PM
Unknown Object (File)
Sun, Sep 15, 1:14 PM
Unknown Object (File)
Sun, Sep 15, 1:13 PM
Unknown Object (File)
Sun, Sep 15, 12:53 PM
Subscribers

Details

Summary

It's generally better for performance to let this be async, especially if it's implemented natively and can take advantage of threading / parallelism.

Putting this as a separate diff because I think it has some separate risks.

Depends on D9294

Test Plan

See parent diff's test plan

Diff Detail

Repository
rCOMM Comm
Branch
ashoat/brotli
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

keyserver/src/socket/socket.js
263

Normally it's an anti-pattern to await in sequence like this. But in this case, we have a requirement that this array of serverResponses is delivered in order. See this code

lib/utils/sequential-promise-resolver.js
27

Similar to above, it's important that we await in sequence here as the messages must be delivered in order. For more context, see D355

Glad it wasn't too much overhead to use the async versions of the brotli functions

keyserver/src/socket/socket.js
263

Might be worth adding a comment for future readers who might think of "fixing" this in the future?

This revision is now accepted and ready to land.Sep 26 2023, 1:32 PM
This revision was landed with ongoing or failed builds.Sep 26 2023, 1:44 PM
This revision was automatically updated to reflect the committed changes.