Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(minifier): replace Number.*_SAFE_INTEGER/Number.EPSILON #8682

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sapphi-red
Copy link
Contributor

@sapphi-red sapphi-red commented Jan 23, 2025

The value of Number.*_SAFE_INTEGER, Number.EPSILON are constants as they cannot be changed. This PR replaces them with 2**53-1 / -(2**53-1) / 2**-52 for ES2016+. For ES2015, Number.EPSILON is not changed but Number.*_SAFE_INTEGERs are replaced with 9007199254740991 / -9007199254740991.

Reference

Additional Information

  • Number.MIN_VALUE cannot be replaced as the value depends on the runtime
  • Number.MAX_VALUE can be replaced but I didn't come up with a shorter representation that does not lack precision

Copy link
Contributor Author

sapphi-red commented Jan 23, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added A-minifier Area - Minifier C-enhancement Category - New feature or request labels Jan 23, 2025
@sapphi-red sapphi-red force-pushed the 01-22-feat_minifier_replace_number.positive_infinity___number.negative_infinity___number.nan_ branch from 435b45e to 5896784 Compare January 23, 2025 15:20
@sapphi-red sapphi-red force-pushed the 01-22-feat_minifier_replace_number.__safe_integer___number.epsilon_ branch from af223f6 to a506b39 Compare January 23, 2025 15:20
@Boshen Boshen changed the base branch from 01-22-feat_minifier_replace_number.positive_infinity___number.negative_infinity___number.nan_ to graphite-base/8682 January 23, 2025 15:26
Copy link

codspeed-hq bot commented Jan 23, 2025

CodSpeed Performance Report

Merging #8682 will not alter performance

Comparing 01-22-feat_minifier_replace_number._safe_integer___number.epsilon (5d4f889) with main (0c5bb30)

Summary

✅ 32 untouched benchmarks

@sapphi-red sapphi-red marked this pull request as ready for review January 23, 2025 15:29
@Boshen Boshen force-pushed the graphite-base/8682 branch from 5896784 to 0c5bb30 Compare January 23, 2025 15:31
@Boshen Boshen force-pushed the 01-22-feat_minifier_replace_number.__safe_integer___number.epsilon_ branch from a506b39 to 649631c Compare January 23, 2025 15:31
@Boshen Boshen changed the base branch from graphite-base/8682 to main January 23, 2025 15:32
@Boshen Boshen force-pushed the 01-22-feat_minifier_replace_number.__safe_integer___number.epsilon_ branch from 649631c to 5d4f889 Compare January 23, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-minifier Area - Minifier C-enhancement Category - New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant