Skip to content

Commit

Permalink
perf: promise.all flag and arg caching
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Oct 12, 2023
1 parent 14a0e48 commit c592ce0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/util/cache-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,10 @@ export async function cacheCommand(
// @ts-expect-error because v2 commands have base flags stored in _baseFlags
const uncachedBaseFlags = cmd.baseFlags ?? cmd._baseFlags

const flags = await cacheFlags(
aggregateFlags(uncachedFlags, uncachedBaseFlags, cmd.enableJsonFlag),
respectNoCacheDefault,
)
const args = await cacheArgs(ensureArgObject(cmd.args), respectNoCacheDefault)
const [flags, args] = await Promise.all([
await cacheFlags(aggregateFlags(uncachedFlags, uncachedBaseFlags, cmd.enableJsonFlag), respectNoCacheDefault),
await cacheArgs(ensureArgObject(cmd.args), respectNoCacheDefault),
])

const stdProperties = {
aliases: cmd.aliases || [],
Expand Down

0 comments on commit c592ce0

Please sign in to comment.