Page MenuHomePhabricator

[keyserver] Use async version of brotliCompress
ClosedPublic

Authored by ashoat on Sep 26 2023, 1:08 PM.
Tags
None
Referenced Files
F3383850: D9298.id31432.diff
Thu, Nov 28, 6:02 PM
Unknown Object (File)
Mon, Nov 25, 2:55 AM
Unknown Object (File)
Mon, Nov 25, 2:30 AM
Unknown Object (File)
Mon, Nov 25, 12:44 AM
Unknown Object (File)
Thu, Nov 21, 10:41 AM
Unknown Object (File)
Wed, Nov 20, 4:39 PM
Unknown Object (File)
Wed, Nov 20, 4:39 PM
Unknown Object (File)
Wed, Nov 20, 4:39 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.