-
Notifications
You must be signed in to change notification settings - Fork 361
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
The performance will be very poor when using apiAt heavily. #4707
Comments
It should check the runtime version first and find a match of exiting metadata. If not there is an issue. api/packages/api/src/base/Init.ts Line 156 in a98e954
retrieval happens there. It could very well be related to the fact that it goes in parallel, ie. It doesn’t have the cache as of yet. |
Looking at the above, while JS is single-threaded, it is indeed due to the parallel nature. One after the other and the above would indeed kick-in. There is actually 2 useful enhancements here to cater for this specific use:
Overall though, the logic above works well to not duplicate when used in a serial fashion, but all at once would need a bit of love since requests don't cross-track (and quite a bit of testing to get right) |
thanks |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query. |
This is the test code:
For 70 consecutive blocks, each block seems to fetch the metadata and create a new api object. Here's the result I got:
Even if I reduce the number of concurrent requests, it will take several seconds.
Although I know that getting the metadata and decoding the metadata can be very time taking. But the fact is that the metadata for these blocks should be the same.
Wouldn't it be better to cache the api according to runtimeversion?
The text was updated successfully, but these errors were encountered: