Page MenuHomePhabricator

[keyserver] Use async version of brotliCompress
ClosedPublic

Authored by ashoat on Sep 26 2023, 1:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 1, 12:08 PM
Unknown Object (File)
Fri, Nov 1, 12:07 PM
Unknown Object (File)
Fri, Nov 1, 12:06 PM
Unknown Object (File)
Fri, Nov 1, 12:06 PM
Unknown Object (File)
Fri, Nov 1, 11:45 AM
Unknown Object (File)
Sat, Oct 19, 4:20 AM
Unknown Object (File)
Sat, Oct 19, 4:20 AM
Unknown Object (File)
Sat, Oct 19, 4:20 AM
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.