You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently one of the biggest slowdown we see in forc-pkg happens (after the cold run which fetches std) is resolution of commit hash of tag's HEAD. This is done to check if the local copy of the dependency can be used which is cached by the commit hash. So in each forc build we make a shallow fetch using git2-rs. This shallow fetching although helping, is still a little slow with sway repo itself. Now the main reason we are using git to do this is because we want to be provider agnostic. Meaning that we are not locked to github but also fetch from bitbucket etc. Now i believe most of our dependencies will happen to be on github and we can add a specical case which checks if the git source is coming from github. If that is the case we can get the commit hash of particular tag with an API call.
This will enables us to quickly start searching local, instead of spending time to do shallow fetching of the sway repo. If this fails, or the source is from another provider, we can fallback into the current method.
Note: we need to do this commit checking for the current tag each time since it is possible that a tag is created and then deleted, re-created etc. So we cannot cache this completely while covering all edge cases but we can fetch it faster via the api for github packages.
The text was updated successfully, but these errors were encountered:
Currently one of the biggest slowdown we see in forc-pkg happens (after the cold run which fetches std) is resolution of commit hash of tag's HEAD. This is done to check if the local copy of the dependency can be used which is cached by the commit hash. So in each forc build we make a shallow fetch using git2-rs. This shallow fetching although helping, is still a little slow with sway repo itself. Now the main reason we are using git to do this is because we want to be provider agnostic. Meaning that we are not locked to github but also fetch from bitbucket etc. Now i believe most of our dependencies will happen to be on github and we can add a specical case which checks if the git source is coming from github. If that is the case we can get the commit hash of particular tag with an API call.
ex:
https://api.github.com/repos/FuelLabs/sway/git/ref/tags/v0.58.0
This will enables us to quickly start searching local, instead of spending time to do shallow fetching of the sway repo. If this fails, or the source is from another provider, we can fallback into the current method.
Note: we need to do this commit checking for the current tag each time since it is possible that a tag is created and then deleted, re-created etc. So we cannot cache this completely while covering all edge cases but we can fetch it faster via the api for github packages.
The text was updated successfully, but these errors were encountered: