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

perf: decouple item counting logic from data fetching #581

Merged
merged 15 commits into from
Sep 26, 2024

Conversation

PJColombo
Copy link
Member

@PJColombo PJColombo commented Sep 22, 2024

Checklist

  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

IT BUILTS ON TOP PR #577

Resolves #572

Motivation and Context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

Copy link

changeset-bot bot commented Sep 22, 2024

🦋 Changeset detected

Latest commit: dc6188f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@blobscan/web Patch
@blobscan/api Minor
@blobscan/rest-api-server Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Sep 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blobscan-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 26, 2024 1:41am
blobscan-staging ❌ Failed (Inspect) Sep 26, 2024 1:41am
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
blobscan-gnosis ⬜️ Ignored (Inspect) Visit Preview Sep 26, 2024 1:41am
blobscan-holesky ⬜️ Ignored (Inspect) Visit Preview Sep 26, 2024 1:41am
blobscan-mainnet ⬜️ Ignored (Inspect) Visit Preview Sep 26, 2024 1:41am
blobscan-sepolia ⬜️ Ignored (Inspect) Visit Preview Sep 26, 2024 1:41am

Copy link

codecov bot commented Sep 22, 2024

Codecov Report

Attention: Patch coverage is 97.61905% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.27%. Comparing base (7ec4c4c) to head (dc6188f).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/api/src/routers/block/getAll.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #581      +/-   ##
==========================================
- Coverage   89.28%   89.27%   -0.02%     
==========================================
  Files         150      150              
  Lines        9922     9922              
  Branches     1035     1033       -2     
==========================================
- Hits         8859     8858       -1     
- Misses       1063     1064       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Sep 22, 2024

📦 Next.js Bundle Analysis for @blobscan/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 283.8 KB (🟡 +38.18 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

New Pages Added

The following pages were added to the bundle from the code in this PR:

Page Size (compressed) First Load % of Budget (350 KB)
/block_neighbor 251 B 284.04 KB 81.15%
/stats 347.54 KB 631.33 KB 180.38%

Eight Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/ 351.83 KB 635.63 KB 181.61% (🟢 -5.00%)
/address/[address] 26.96 KB 310.75 KB 88.79% (🟢 -4.79%)
/blob/[hash] 27.63 KB 311.42 KB 88.98% (🟢 -4.23%)
/blobs 76.52 KB 360.31 KB 102.95% (🟡 +12.48%)
/block/[id] 14.31 KB 298.11 KB 85.17% (🟢 -4.15%)
/blocks 74.22 KB 358.01 KB 102.29% (🟡 +12.47%)
/tx/[hash] 16.31 KB 300.11 KB 85.75% (🟡 +0.87%)
/txs 73.72 KB 357.52 KB 102.15% (🟡 +10.46%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@PJColombo PJColombo changed the base branch from main to feat/add-count-query-param September 23, 2024 12:06
Base automatically changed from feat/add-count-query-param to main September 25, 2024 12:29
@PJColombo PJColombo force-pushed the refactor/separate-items-counting-logic branch from e9a20ac to dc6188f Compare September 26, 2024 01:26
@PJColombo PJColombo merged commit bd8a4cb into main Sep 26, 2024
7 of 14 checks passed
@PJColombo PJColombo deleted the refactor/separate-items-counting-logic branch September 26, 2024 01:30
@github-actions github-actions bot mentioned this pull request Oct 6, 2024
luis-herasme pushed a commit that referenced this pull request Oct 13, 2024
* fix(api): set category filter to `ROLLUP` when the rollup filter is provided

* feat(api): create blob `getCount` procedure

* chore: add changeset

* refactor(web): use `getCount()` procedure to retrieve total amount of blobs

* chore: add changeset

* feat(api): create block `getCount` procedure

* chore: add changeset

* fix(web): align header sleketon on blobs page view

* refactor(web): use `getCount()` procedure to retrieve total amount of blocks

* refactor(api): use count logic in `getAll` block procedure

* feat(api): add transaction `getCount` procedure

* refactor(web): use `getCount()` procedure to retrieve total amount of transactions on txs page

* chore: merge changesets

* refactor(web): organize query parameters by filter and pagination usage

* test(api): remove rollup test
luis-herasme pushed a commit that referenced this pull request Oct 19, 2024
* fix(api): set category filter to `ROLLUP` when the rollup filter is provided

* feat(api): create blob `getCount` procedure

* chore: add changeset

* refactor(web): use `getCount()` procedure to retrieve total amount of blobs

* chore: add changeset

* feat(api): create block `getCount` procedure

* chore: add changeset

* fix(web): align header sleketon on blobs page view

* refactor(web): use `getCount()` procedure to retrieve total amount of blocks

* refactor(api): use count logic in `getAll` block procedure

* feat(api): add transaction `getCount` procedure

* refactor(web): use `getCount()` procedure to retrieve total amount of transactions on txs page

* chore: merge changesets

* refactor(web): organize query parameters by filter and pagination usage

* test(api): remove rollup test
luis-herasme pushed a commit that referenced this pull request Oct 19, 2024
* fix(api): set category filter to `ROLLUP` when the rollup filter is provided

* feat(api): create blob `getCount` procedure

* chore: add changeset

* refactor(web): use `getCount()` procedure to retrieve total amount of blobs

* chore: add changeset

* feat(api): create block `getCount` procedure

* chore: add changeset

* fix(web): align header sleketon on blobs page view

* refactor(web): use `getCount()` procedure to retrieve total amount of blocks

* refactor(api): use count logic in `getAll` block procedure

* feat(api): add transaction `getCount` procedure

* refactor(web): use `getCount()` procedure to retrieve total amount of transactions on txs page

* chore: merge changesets

* refactor(web): organize query parameters by filter and pagination usage

* test(api): remove rollup test
luis-herasme pushed a commit that referenced this pull request Oct 19, 2024
* fix(api): set category filter to `ROLLUP` when the rollup filter is provided

* feat(api): create blob `getCount` procedure

* chore: add changeset

* refactor(web): use `getCount()` procedure to retrieve total amount of blobs

* chore: add changeset

* feat(api): create block `getCount` procedure

* chore: add changeset

* fix(web): align header sleketon on blobs page view

* refactor(web): use `getCount()` procedure to retrieve total amount of blocks

* refactor(api): use count logic in `getAll` block procedure

* feat(api): add transaction `getCount` procedure

* refactor(web): use `getCount()` procedure to retrieve total amount of transactions on txs page

* chore: merge changesets

* refactor(web): organize query parameters by filter and pagination usage

* test(api): remove rollup test
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.

Move elements count to its own procedure (blocks, txs and blobs)
1 participant