Skip to content

Improve performance when displaying event lists, using newly available data#761

Merged
csillag merged 1 commit into
masterfrom
csillag/optimize-runtime-event-list
Aug 1, 2023
Merged

Improve performance when displaying event lists, using newly available data#761
csillag merged 1 commit into
masterfrom
csillag/optimize-runtime-event-list

Conversation

@csillag
Copy link
Copy Markdown
Contributor

@csillag csillag commented Jul 20, 2023

This depends on oasisprotocol/nexus#491.

Please note that while this version is backward compatible with the currently deployed staging or production versions of nexus, the performance improvements will only be realized if the new version of nexus is deployed.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 20, 2023

Deployed to Cloudflare Pages

Latest commit: 33c5eff5b4f8dbea3e5dbd10a686fe0a9c6a7764
Status:✅ Deploy successful!
Preview URL: https://84e2c432.oasis-explorer.pages.dev

Comment thread src/app/components/Tokens/TokenTransfers.tsx Outdated
@csillag csillag force-pushed the csillag/optimize-runtime-event-list branch 2 times, most recently from 8e05db0 to 61c179a Compare July 20, 2023 22:57
@csillag csillag requested a review from lukaw3d July 20, 2023 22:58
@csillag
Copy link
Copy Markdown
Contributor Author

csillag commented Jul 21, 2023

Tested with latest staging Nexus deployment, seems to work fine. (For testing, I had to change the API endpoints to staging, and enable Emerald.)

content: transfer.evm_log_details?.token_type ? (
<EventBalance event={transfer} tickerAsLink={differentTokens} />
) : (
<DelayedEventBalance event={transfer} tickerAsLink={differentTokens} />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can delayed versions of these components ever actually obtain more information, if backend JOIN couldn't?
Or is this so that we can deploy before API is updated, and later remove it?

Copy link
Copy Markdown
Contributor Author

@csillag csillag Jul 24, 2023

Choose a reason for hiding this comment

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

Yes, the intention behind the current code is that it should work optimally if the newly added data is present, and fall back gracefully to lower performance if it's not.

As far as I can understand, this data will always be there for transfers, so maybe we can remove the delayed codepath later, but then again, it's a bit vague what do we consider to be a transfer, so I am not enterely certain about that. (But I'll try to check with the Nexus devs.)

@csillag csillag force-pushed the csillag/optimize-runtime-event-list branch from 61c179a to 07e48d0 Compare August 1, 2023 00:56
@csillag
Copy link
Copy Markdown
Contributor Author

csillag commented Aug 1, 2023

Now that the relevant Nexus changes have been merged, this PR has also been updated accordingly.

@csillag csillag force-pushed the csillag/optimize-runtime-event-list branch from 079cdee to 802dc6b Compare August 1, 2023 01:28
Instead of looking up the referenced tokens, try to use
the data available as part of the runtime event info.
@csillag csillag force-pushed the csillag/optimize-runtime-event-list branch from 802dc6b to 33c5eff Compare August 1, 2023 15:48
@csillag csillag merged commit 347f2b7 into master Aug 1, 2023
@csillag csillag deleted the csillag/optimize-runtime-event-list branch August 1, 2023 15:56
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