Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

feat(rome_js_semantic): model improvements #3825

Merged
merged 2 commits into from
Nov 23, 2022

Conversation

xunilrj
Copy link
Contributor

@xunilrj xunilrj commented Nov 22, 2022

Summary

This PR reorganize the semantic model into multiple files.
It also improve performance by exchanging some hashing to simple Vec indexing.

The main point was to rename all declaration() methods to binding().

Test Plan

> cargo test

@netlify
Copy link

netlify bot commented Nov 22, 2022

Deploy Preview for docs-rometools ready!

Name Link
🔨 Latest commit 5f5e618
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/637dfbcf615b070008694e8d
😎 Deploy Preview https://deploy-preview-3825--docs-rometools.netlify.app/playground
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@xunilrj xunilrj force-pushed the feature/semantic-model-improvements branch from 9d7cfa7 to ad1f3be Compare November 22, 2022 23:27
@xunilrj
Copy link
Contributor Author

xunilrj commented Nov 23, 2022

!bench_analyzer

@github-actions
Copy link

Analyzer Benchmark Results

group                     main                                   pr
-----                     ----                                   --
analyzer/css.js           1.02      2.8±0.02ms     4.1 MB/sec    1.00      2.8±0.03ms     4.2 MB/sec
analyzer/index.js         1.05      7.4±0.07ms     4.4 MB/sec    1.00      7.1±0.08ms     4.6 MB/sec
analyzer/lint.ts          1.09      3.6±0.03ms    11.5 MB/sec    1.00      3.3±0.03ms    12.6 MB/sec
analyzer/parser.ts        1.07      8.8±0.11ms     5.6 MB/sec    1.00      8.2±0.07ms     6.0 MB/sec
analyzer/router.ts        1.06      6.1±0.06ms    10.3 MB/sec    1.00      5.8±0.05ms    10.9 MB/sec
analyzer/statement.ts     1.03      8.2±0.08ms     4.3 MB/sec    1.00      8.0±0.07ms     4.5 MB/sec
analyzer/typescript.ts    1.03     12.2±0.12ms     4.5 MB/sec    1.00     11.8±0.12ms     4.6 MB/sec

@rome rome deleted a comment from github-actions bot Nov 23, 2022
@xunilrj xunilrj force-pushed the feature/semantic-model-improvements branch from ad1f3be to 5f5e618 Compare November 23, 2022 10:54
@xunilrj xunilrj marked this pull request as ready for review November 23, 2022 11:06
@calibre-analytics
Copy link

Comparing Feature/semantic model improvements Snapshot #1 to median since last deploy of rome.tools.

LCP? CLS? TBT?
Overall
Median across all pages and test profiles
621ms
from 264ms
0.049
from 0.009
0ms
no change
Chrome Desktop
Chrome Desktop • Cable
621ms
from 264ms
0.044
from 0.005
0ms
no change
iPhone, 4G LTE
iPhone 12 • 4G LTE
242ms
from 238ms
0.078
from 0.009
0ms
no change
Motorola Moto G Power, 3G connection
Motorola Moto G Power • Regular 3G
1.25s
from 1.07s
0.049
from 0.009
0ms
no change

1 page tested

 Home

Browser previews

Chrome Desktop iPhone, 4G LTE Motorola Moto G Power, 3G connection
Chrome Desktop iPhone, 4G LTE Motorola Moto G Power, 3G connection

Most significant changes

Value Budget
Total JavaScript Size in Bytes
Chrome Desktop
1.33 MB
from 86.8 KB
Total JavaScript Size in Bytes
iPhone, 4G LTE
1.33 MB
from 86.8 KB
Total JavaScript Size in Bytes
Motorola Moto G Power, 3G connection
1.33 MB
from 86.8 KB
Cumulative Layout Shift
Chrome Desktop
0.044
from 0.005
Cumulative Layout Shift
iPhone, 4G LTE
0.078
from 0.009

19 other significant changes: Cumulative Layout Shift on Motorola Moto G Power, 3G connection, Number of Requests on Chrome Desktop, Number of Requests on iPhone, 4G LTE, Number of Requests on Motorola Moto G Power, 3G connection, Total Page Size in Bytes on Chrome Desktop, Total Page Size in Bytes on iPhone, 4G LTE, Total Page Size in Bytes on Motorola Moto G Power, 3G connection, Largest Contentful Paint on Chrome Desktop, First Contentful Paint on Chrome Desktop, Time to Interactive on Chrome Desktop, Total Image Size in Bytes on Chrome Desktop, Total Image Size in Bytes on iPhone, 4G LTE, Total Image Size in Bytes on Motorola Moto G Power, 3G connection, Total CSS Size in Bytes on Chrome Desktop, Total CSS Size in Bytes on iPhone, 4G LTE, Total CSS Size in Bytes on Motorola Moto G Power, 3G connection, Total HTML Size in Bytes on Chrome Desktop, Total HTML Size in Bytes on iPhone, 4G LTE, Total HTML Size in Bytes on Motorola Moto G Power, 3G connection

Calibre: Site dashboard | View this PR | Edit settings | View documentation

@ematipico ematipico changed the title Feature/semantic model improvements feat(rome_js_semantic): model improvements Nov 23, 2022
@xunilrj xunilrj merged commit c7f887d into main Nov 23, 2022
@xunilrj xunilrj deleted the feature/semantic-model-improvements branch November 23, 2022 11:18
jeysal added a commit to jeysal/rometools that referenced this pull request Nov 24, 2022
* upstream/main: (73 commits)
  fix(semantic_analyzers): style/noShoutyConstants does not recognize multiple uses of a constant. (rome#3789)
  feat(rome_js_analyze): useDefaultSwitchClauseLast (rome#3791)
  chore: run rustfmt and typo fix (rome#3840)
  feat(rome_js_analyze): use exhaustive deps support properties (rome#3581)
  website(docs): Fix text formatting (rome#3828)
  feat(rome_js_analyze): `noVoidTypeReturn` (rome#3806)
  feat(rome_cli): expose the `--verbose` flag to the CLI (rome#3812)
  fix(rome_diagnostics): allow diagnostic locations to be created without a resource (rome#3834)
  feat(rome_js_analyze): add noExtraNonNullAssertion rule (rome#3797)
  fix(rome_lsp): lsp friendly catch unwind (rome#3740)
  feat(rome_js_semantic): model improvements (rome#3825)
  feat(rome_json_parser): JSON Lexer (rome#3809)
  feat(rome_js_analyze): implement `noDistractingElements` (rome#3820)
  fix(rome_js_formatter): shothanded named import line break with default import (rome#3826)
  feat(rome_js_analyze): `noConstructorReturn` (rome#3805)
  feat(website): change enabledNurseryRules to All/Recommended select (rome#3810)
  feat(rome_js_analyze): noSetterReturn
  feat(rome_js_analyze): noConstructorReturn
  feat(rome_analyze): suppress rule via code actions (rome#3572)
  feat(rome_js_analyze): `noVar` (rome#3765)
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants