-
-
Notifications
You must be signed in to change notification settings - Fork 782
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add optional cache to repository #5744
Comments
In what scenario do you need this function?Currently, the speed of running Describe possible solutionsAdd a cache file to the official xmake-repo. When searching for packages, you do not need to traverse each folder one by one. For private repositories without cache, use the original method. Cache updates can be handed over to ci for automatic updates, and commit is added when syncing from dev to master. Describe your alternativesDo not change xmake-repo, but generate a local cache when running xrepo search locally. If xmake-repo commit remains unchanged, the cache does not need to be updated. Other informationNo response |
其实主要的瓶颈不是遍历目录,是遍历的同时,还要挨个 load xmake.lua 去解析 description ,因为要从 desc 中搜,全量加载包配置才是最耗时的。 试下这个 patch ,应该会快不少 Beforeruki-2:tmp ruki$ time xrepo search "tbox"
The package names:
tbox:
-> tbox-v1.7.5: A glib-like multi-platform c library (in xmake-repo)
-> cpp-tbox-2023.12.13: A complete Linux application software development tool library an
d runtime framework, aim at make C++ development easy. (in xmake-repo)
real 0m3.797s
user 0m1.184s After首次不会快,缓存后第二次会快。 ruki-2:tmp ruki$ time xrepo search "tbox"
The package names:
tbox:
-> tbox: A glib-like multi-platform c library (in xmake-repo)
-> cpp-tbox: A complete Linux application software development tool library and runtime f
ramework, aim at make C++ development easy. (in xmake-repo)
real 0m1.220s
user 0m0.436s
sys 0m0.526s |
哦不对,现在用时是check visual studio导致的,search已经足够快了 |
In fact, the main bottleneck is not to traverse the directory, but to load xmake.lua one by one to parse the description while traversing, because it is the most time-consuming to search from desc and fully load the package configuration. Try this patch, it should be much faster |
Oh no, the current time is caused by checking visual studio. Search is already fast enough. |
既然没问题,那我就关了 |
Since there's no problem, I'll turn it off |
你在什么场景下需要该功能?
目前运行
xrepo search <xxx>
的速度非常慢,看了一下log是卡在遍历xmake-repo的所有文件上了,现在随着xmake-repo package数量越来越多,也应该加上一个cache描述可能的解决方案
给官方xmake-repo加一个cache文件,搜索package时不需要逐个文件夹去遍历;对没有cache的私有仓库还是走原来的方式。cache的更新可以交给ci自动更新,从dev到master sync的时候加commit
描述你认为的候选方案
不改动xmake-repo,但在本地运行xrepo search的时候生成本地cache,xmake-repo commit不变则cache也不用更新
其他信息
No response
The text was updated successfully, but these errors were encountered: