Skip to content
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

Build process is slow to start #46

Closed
camthesaxman opened this issue Sep 27, 2016 · 10 comments
Closed

Build process is slow to start #46

camthesaxman opened this issue Sep 27, 2016 · 10 comments

Comments

@camthesaxman
Copy link
Contributor

When running 'make' to rebuild the project after changing a single file (or when not even changing anything), it takes almost a whole minute before it starts compiling. This makes it rather annoying when trying to test my C code against the disassembly. I presume this is due to the massive amount of dependencies that Make has to keep track of and checking the timestamp on the thousands of files in the graphics directory takes some time.

@RevoSucks
Copy link
Collaborator

RevoSucks commented Sep 28, 2016

Specs?

time make -j16 from make clean results in:

real    2m17.331s
user    1m26.897s
sys     4m53.771s

I don't see a "minute delay" when updating pokeruby.

@ghost
Copy link

ghost commented Sep 28, 2016

It takes around 4 seconds to run make if I haven't made any changes on my machine, after the first time I've run it. It's slower the first time, though.

If you want to modify the code but not any of the graphics, you could consider using a modified makefile that doesn't scan the asm files for dependencies.

@camthesaxman
Copy link
Contributor Author

This is on my old Pentium 4 desktop (Yeah, I refuse to let it go). Most of the time is dominated by disk activity from scaninc which seems to recursively scan the .s files every time make is invoked. I've put in a rule in my custom Makefile to build .s files from .c files, so I can type "make src/foo.s" and instantly have it compile foo.c into foo.s with no delay.

@ghost
Copy link

ghost commented Oct 1, 2016

Good idea.

@camthesaxman
Copy link
Contributor Author

I've noticed that even when trying to compile a single C file, for example, make src/wallclock.o VERSION=RUBY, make runs scaninc on all of the .s files in data, even though wallclock.o should not depend on any of those files. Scaninc recursively scans the files, and on a slow hard disk, this can take up to 10 seconds, doing something totally pointless. I don't know enough about make to debug why it's pulling dependencies from there, but nothing in src should depend on anything in data at all.

@yenatch
Copy link
Contributor

yenatch commented Dec 12, 2016

make NODEP=1

@ghost
Copy link

ghost commented Jan 7, 2017

NODEP solves this issue.

@ghost ghost closed this as completed Jan 7, 2017
@RevoSucks
Copy link
Collaborator

NODEP only solves it if you are making changes to just the assembly or programming and not changing any header files. If you are doing anything else, you still need to wait.

@ghost
Copy link

ghost commented Jan 7, 2017

Not much can be done about that, except for caching the dependencies, possibly.

@yenatch
Copy link
Contributor

yenatch commented Jan 8, 2017

You still have to stat the files, which isn't exactly fast. Ideally you could listen for filesystem changes (eg linux inotify or windows System.IO.FileSystemWatcher) instead.

This issue was closed.
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

No branches or pull requests

3 participants