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
Add a way to run bob with a specific list of updated resources #8490
Comments
I would love to see bob incremental builds- I also build using bob, but mostly via shell scripting. I would really love if bob's output included a cache of file modification times or some other data so that I could run bob incrementally as long as that cache persisted. I maintain multiple concurrent build directories (client / server) so this would need to be cached by build. I see there's already a |
Take a look at https://defold.com/manuals/caching-assets/. Maybe it will be helpful. |
Yep, adding a local cache will surely help a bit. But I suppose one problem with bob compare to the editor is that the editor is loaded, ready and has the full project state in memory, which makes it really fast to rebuild changed assets. Bob on the other hand need to start a java vm, load the classes of bob.jar, load the entire project and the build it. I would like to point out that bob will not rebuild something that is already built, but it does ofc have to do some processing (read file and measure checksums) to figure out if it has to be rebuilt or not. |
Is this the equivalent of running the |
May be we need measurements of some large project to see what takes the longest. I don't have huge projects. My small ones with a dozen collections, several atlases and half a hundred lua scripts take 5 to 15 seconds to build second time, which is acceptable to me. But in the editor, yes, it is faster, takes about 2-3 seconds. @swajj As far as I know you have not a small project. Maybe you could share the build log measurements? |
Bob already supports incremental builds. It does so by using a cache. Are you sure you're not calling it with the Also note that bob was/is designed to be run once, not to be run as a server (like the editor), so you'll always pay for the startup time (compare with the loading of a project in the editor). I'm not sure what we can do to speed up the initial loading of the project when starting bob. |
Also, the process is more complex than simply checking if a file has changed to decide on a rebuild. As Björn mentioned:
However, it involves more than just reading the file and getting its checksum. We run the The editor maintains the dependency tree in memory and always knows exactly what needs to be rebuilt at any point in time. Bob, on the other hand, cannot do this and must read this tree from the project files all the time (that's what the |
Sure, there is a difference. I don't have large projects, so maybe my measurements aren't representative, but I tried to record 4 logs and separate in them intervals that either take appreciable time or are very different between the first and second builds.
Despite saving on matches (I'm personally happy with the current build time anyway), what can we see here that's interesting? The first number is clean build and the second is an incremental build. Total for catsday — 7.8 vs 7.4 seconds 🤷♂️.
Total for walker — 3.8 vs 1.7 seconds ✅.
So, I don't know, if |
Yeah, not sure what things are processed in the actual last bit (99% to 100%), and it seems worth investigating. |
The build time with bob is longer than in Defold Editor.
This is noticeable when using the Defold Kit VS Code extension, which uses bob to build and run the game for debugging. But in this case, when using Defold Kit most often you don't need to rebuild all the resources, only the modified ones, like it works in Defold Editor.
Tracking of changed files is possible in VS Code, there is an API for that. So adding tracking to Defold Kit should not be difficult.
This feature request is about adding some API for bob to rebuild only the list of changed resources and not waste time on unchanged ones. I realise it's low priority, but added this issue to have it.
Related issue — astrochili/vscode-defold#33.
The text was updated successfully, but these errors were encountered: