Thanks to visit codestin.com
Credit goes to github.com

Skip to content

FIX: greatly improve startup time#8489

Merged
Overtorment merged 1 commit into
masterfrom
fix-startup-time
Apr 21, 2026
Merged

FIX: greatly improve startup time#8489
Overtorment merged 1 commit into
masterfrom
fix-startup-time

Conversation

@Overtorment

Copy link
Copy Markdown
Member

managed to finaly do lots of performance investigation with the help of cursor and opus 4.7.
HUGE SUCCESS, shed 4 sec of boot time on android! just by rearranging imports

Comment thread blue_modules/BlueElectrum.ts
Comment thread blue_modules/BlueElectrum.ts Outdated
Comment thread class/wallets/legacy-wallet.ts Outdated
@GladosBlueWallet

Copy link
Copy Markdown
Collaborator

Wake the fuck up samurai, we have PRs to merge

image

[all PRs for @marcosrdz] https://github.com/BlueWallet/BlueWallet/pulls/review-requested/marcosrdz

@GladosBlueWallet

Copy link
Copy Markdown
Collaborator

Wake the fuck up samurai, we have PRs to merge

image

[all PRs for @ojokne] https://github.com/BlueWallet/BlueWallet/pulls/review-requested/ojokne

@GladosBlueWallet GladosBlueWallet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated sweep notes (I am obligated to be helpful). Two concrete module-load hazards:

  1. Type-only exports: please make these so Metro/Hermes never tries to resolve non-existent runtime exports.
  2. This keeps the startup-win intact by avoiding extra module work.

Comment thread components/Context/StorageProvider.tsx
Comment thread screen/wallets/ManageWallets.tsx

@GladosBlueWallet GladosBlueWallet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up (previous bot review text got eaten by shell command-substitution, my fault). Concrete issue: types exported with TypeScript "export type" should be imported with TypeScript "import type" (or otherwise kept type-only) so the runtime bundle does not try to resolve missing exports during startup.

import React, { createContext, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { LayoutAnimation } from 'react-native';
import { BlueApp as BlueAppClass, LegacyWallet, TCounterpartyMetadata, TTXMetadata, WatchOnlyWallet } from '../../class';
import { BlueApp as BlueAppClass, TCounterpartyMetadata, TTXMetadata } from '../../class/blue-app';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TCounterpartyMetadata and TTXMetadata are declared as type-only exports in class/blue-app.ts. Since this import also brings in BlueApp as a runtime value, please split the import so those two are brought in via a type-only import. This avoids runtime missing-export hazards and avoids extra work during startup.

import loc from '../../loc';
import { useStorage } from '../../hooks/context/useStorage';
import { TTXMetadata } from '../../class';
import { TTXMetadata } from '../../class/blue-app';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TTXMetadata is a type-only export. Please import it via a type-only import so it cannot become a runtime dependency / missing-export edge case.

@limpbrains limpbrains left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@Overtorment Overtorment merged commit 66cf16f into master Apr 21, 2026
14 checks passed
@Overtorment Overtorment deleted the fix-startup-time branch April 21, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants