Page MenuHomePhabricator

[keyserver] Use async version of brotliCompress
ClosedPublic

Authored by ashoat on Sep 26 2023, 1:08 PM.
Tags
None
Referenced Files
F3363664: D9298.id31429.diff
Mon, Nov 25, 2:55 AM
F3363546: D9298.id31428.diff
Mon, Nov 25, 2:30 AM
F3363187: D9298.diff
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
Unknown Object (File)
Wed, Nov 20, 4:37 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

keyserver/src/socket/socket.js
263 ↗(On Diff #31428)

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 ↗(On Diff #31428)

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 ↗(On Diff #31428)

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.