Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -675,10 +675,16 @@ export class MultichainAccountService {
toGroupIndex: number;
entropySource: EntropySourceId;
}): Promise<MultichainAccountGroup<Bip44Account<KeyringAccount>>[]> {
return await this.#getWallet(entropySource).createMultichainAccountGroups(
console.log(`[PERFORMANCE DEBUG] MultichainAccountService - Creating multichain account groups from ${fromGroupIndex} to ${toGroupIndex} for entropy source: ${entropySource}`);
const start = performance.now();
const result = await this.#getWallet(entropySource).createMultichainAccountGroups(
{ from: fromGroupIndex, to: toGroupIndex },
{ waitForAllProvidersToFinishCreatingAccounts: false },
{ waitForAllProvidersToFinishCreatingAccounts: true },
Comment thread
gantunesr marked this conversation as resolved.
);
const end = performance.now();
console.log(`[PERFORMANCE DEBUG] MultichainAccountService - Time taken to create multichain account groups: ${end - start}ms`);
console.log(`[PERFORMANCE DEBUG] MultichainAccountService - Result: ${result.length} groups created`);
return result;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,18 @@ export abstract class SnapAccountProvider extends BaseBip44AccountProvider {
if (options.type === `${AccountCreationType.Bip44DeriveIndexRange}`) {
if (batched) {
// Batch account creations.
console.log(`[PERFORMANCE DEBUG] SnapAccountProvider ${this.getName()} (createAccountsV2) - Batching account creations with options: ${JSON.stringify(options)}`);
const start = performance.now();
snapAccounts = await createAccountsV2(options);
const end = performance.now();
console.log(`[PERFORMANCE DEBUG] SnapAccountProvider ${this.getName()} (createAccountsV2) - Time taken to create accounts between ${options.range.from} and ${options.range.to}: ${end - start} ms`);
console.log(`[PERFORMANCE DEBUG] SnapAccountProvider ${this.getName()} (createAccountsV2) - Result: ${snapAccounts.length} accounts created`);
} else {
console.log(`[PERFORMANCE DEBUG] SnapAccountProvider ${this.getName()} (createAccountV1) - Creating accounts one by one with options: ${JSON.stringify(options)}`);
const { range } = options;

// Create accounts one by one.
const start = performance.now();
for (
let groupIndex = range.from;
groupIndex <= range.to;
Expand All @@ -401,6 +408,9 @@ export abstract class SnapAccountProvider extends BaseBip44AccountProvider {

snapAccounts.push(snapAccount);
}
const end = performance.now();
console.log(`[PERFORMANCE DEBUG] SnapAccountProvider ${this.getName()} (createAccountV1) - Time taken to create accounts: ${end - start} ms`);
console.log(`[PERFORMANCE DEBUG] SnapAccountProvider ${this.getName()} (createAccountV1) - Result: ${snapAccounts.length} accounts created`);
}

// Group indices are sequential, so we just need the starting index.
Expand Down Expand Up @@ -439,6 +449,7 @@ export abstract class SnapAccountProvider extends BaseBip44AccountProvider {
async createAccounts(
options: CreateAccountOptions,
): Promise<Bip44Account<KeyringAccount>[]> {
console.log(`[PERFORMANCE DEBUG] SnapAccountProvider ${this.getName()} - Creating accounts with options: ${JSON.stringify(options)}`);
assertCreateAccountOptionIsSupported(options, [
`${AccountCreationType.Bip44DeriveIndex}`,
`${AccountCreationType.Bip44DeriveIndexRange}`,
Expand Down
Loading