Skip to content

Resort package.json keys - #255

Merged
whymarrh merged 1 commit into
MetaMask:developfrom
whymarrh:sort-package.json
Aug 14, 2020
Merged

whymarrh merged 1 commit into
MetaMask:developfrom
whymarrh:sort-package.json

Conversation

@whymarrh

@whymarrh whymarrh commented Aug 14, 2020 •

Copy link
Copy Markdown
Contributor

Refs #252

This PR sorts the .dependencies keys in the package.json file.

@whymarrh
whymarrh requested a review from a team as a code owner August 14, 2020 14:35

@Gudahtt Gudahtt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@whymarrh
whymarrh merged commit 44ddd97 into MetaMask:develop Aug 14, 2020
@whymarrh
whymarrh deleted the sort-package.json branch August 14, 2020 14:55
Mrtenz pushed a commit that referenced this pull request Oct 16, 2025
Naz-Ovh pushed a commit to 0x-fork/metamask-core that referenced this pull request Sep 13, 2026
This PR is migrating state of `@metamask/ethjs-unit` from this PR
MetaMask/ethjs-unit#24 to Typescript and moving
it to this repo.

I migrated all existing test cases and also added bunch of new ones.

Just migration to `bigint` improved performance already quite a bit and
I also added few more optimizations to make it even faster.

Here are some results:


#### 1. `getValueOfUnit` - **92.4% faster (13.1x speedup)**

- **Old**: 0.0008ms average, 1,186,924 ops/sec
- **New**: 0.0001ms average, 15,559,761 ops/sec
- **Memory usage**: Minimal impact

#### 2. `numberToString` - **Mixed Results**

- **String inputs**: 43.9% faster (1.8x speedup)
- **Number inputs**: 211.7% slower\*
- **Memory usage**: Negligible difference
- \*Note: Regression due to additional BigInt support in benchmark and
in absolute numbers it's still so fast that is negligible (0.0001ms vs
0.0003ms)

#### 3. `fromWei` - **41.8% to 71.9% faster**

- **Small values**: 41.8% faster (1.7x speedup)
- **Gwei values**: 47.4% faster (1.9x speedup)
- **Ether values**: 47.4% faster (1.9x speedup)
- **Large values**: 52.0% faster (2.1x speedup)
- **With options**: 71.9% faster (3.6x speedup)
- **Memory usage**: 63.8% to 99.2% reduction

#### 4. `toWei` - **55.2% to 79.0% faster**

- **Small values**: 71.2% faster (3.5x speedup)
- **Medium values**: 73.9% faster (3.8x speedup)
- **Large values**: 79.0% faster (4.8x speedup)
- **Decimal values**: 55.2% faster (2.2x speedup)
- **Memory usage**: 63.4% reduction
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.

2 participants