-
Notifications
You must be signed in to change notification settings - Fork 296
Conversation
I've been using eflame to profile rebar runtimes in cases when all files already compiled (so ideally rebar should finish instantly), but it seems like
|
Regarding init_rebarinfo, I'm guessing the biggest gains in time could be to confirm whether the graph has been modified or not on a run, and then avoiding re-writing the file when that happens. Right now it looks like the entire project is serialized again every time, and flushed back to disk, even if nothing changed. That would be a low hanging fruit, I guess. |
@dizzyd my understanding is that each branch does more than the other. You could review v5 only, and if you don't like a feature or something, it may turn out that v4, v3, v2, or v1 already have the separation for that. |
@ferd, @proger, any technical issue with postponing that to after we merge one of the 5 variants first? |
No issue. It's only an inefficient thing. It can be fixed without On 09/20, Tuncer Ayaz wrote:
|
I've started using this version of the patch day-to-day and I like it. Rebar seems super fast now. 👍 |
I've been using it for a while now. No issues. |
Since this also adds the notion of a new file, I will tag rebar as it is, then test this branch as well as I can and merge it in, any problems with that @Tuncer? |
Works for me. |
While discussing lock-deps and erlc-speedup-v5 with @seth, he suggested to introduce a directory for all info files. That's a good idea, and with that implemented, I consider erlc-speedup-v5 ready to merge. That directory is also a good place to store a |
We've been using this patch on our version of rebar at Heroku and it kicks ass - compilation speed is fantastic and day-to-day development feels much better with this patch in rebar. 💯 I would love to see this patch land in mainline. |
thanks a lot for the great speed improvements! I’ve tried this patch for some projects but I’ve encountered some compilation errors while using it. One project has a behaviour module located in a subfolder of
Errors while trying to compile:
Another error appears while trying to compile erlando:
Bisecting with git located the first bad commit at 0796ffe, for both projects. |
@drobakowski thanks for the bug report. I'll look into it. |
@drobakowski can you please retest? |
@Tuncer compiling erlando now works fine! The first example with the modified poolboy worker still doesn't compile. I've uploaded you the modified poolboy worker src on DB. |
@drobakowski that's right, I didn't fix that yet. |
@@ -260,7 +274,7 @@ doterl_compile(Config, OutDir) -> | |||
doterl_compile(Config, OutDir, []). | |||
|
|||
doterl_compile(Config, OutDir, MoreSources) -> | |||
FirstErls = rebar_config:get_list(Config, erl_first_files, []), | |||
ErlFirstErls = rebar_config:get_list(Config, erl_first_files, []), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable name seems to have a bit of redundancy...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to ErlFirstFiles
If this can be squashed into a saner commit history, I think this is ready to merge. |
As some anecdotal evidence, it takes a riak rebuild from 20 to 10 seconds and riak_cs build from 10 to 5 seconds, which is very nice for iterative development. |
Before we can merge this, I first need to fix the 2nd bug reported by @drobakowski, and I'd also welcome a review of the code that skips updating the info file if there's no change. Specifically, whether the logic is correct for the case of a compile error, and if in that case a different update strategy is needed. Once that's all done, I'll look at the commit history. |
The test case provided by @drobakowski passed for me, when I tried it. I thought you had fixed it. |
I have only fixed the first bug. The second problem happens in the 'modified poolboy worker' scenario. |
I can't replicate the error, but maybe I don't understand how to. |
@Tuncer the compile errors also occurs with |
I'm able to reproduce the error on Ubuntu Server 12.04.4 LTS (GNU/Linux 3.2.0-27-generic x86_64) with R16B03-1 64-bit halfword-emu. |
FWIW I am on Arch Linux x64 with erlang R16B02. Andrew |
@drobakowski I have uncovered a 2nd bug and fixed both regressions. Can you please retest? |
@drobakowski thanks for testing, backed out 70ce087. I'd prefer to not hide all erl_syntax[_lib] errors and replaced it with a TODO comment. |
@Tuncer thanks a lot for your great work! :) 👍 |
ping |
This is wonderful in day-to-day use - are there any blockers to merging it into mainline? |
No, I was originally waiting on the bugs @drobakowski found, and hadn't gotten back around to checking in. |
Can you squash this into a saner commit history, please? |
Were the two bugs holding things up fixed here: https://github.com/tuncer/rebar/commit/44ff85aba3a05ad78bd93e18907b2598259a15c3 ? Also, you fixed the bugs, but this branch adds nothing to the regression tests? Should we have tests for those edge cases? |
Are they regressions that affected rebar before this branch, or were they regressions added in the branch? I'm fine with >1 commits for this, but 26 is pretty far beyond what I'd expect for a change of this size. It isn't even easy to tie all these back to this feature being added, if someone was to do a git blame. |
Yes.
We don't really have a test suite for rebar_erlc_compiler, but we should create one. |
Or we can add an inttest that mirrors the issue. |
New regressions added by the initial commit.
If you want me to collapse it into a couple commits, I can try to do that, but it would be a couple commits with long commit messages. Keeping the various fixes and behavioral changes separate helps if we have to git-bisect a problem. Anyway, I'll see what I can squash. |
I'd rather make git bisect and git blame work better than have so many commits. |
That's what I meant by test suite. I'm not sure when I'll have time for that. So, if anyone wants to speed up the merge process, here's what
|
* Do not parse source files twice while checking for relationship. * Keep files relationships in a graph. * The option 'keep_build_info' is introduced. When set to 'true' the graph will be kept in ebin/.rebar.build.info and will be used by further compiler calls. The default is 'false'.
Collapsed commits as much as possible. |
* update files * fix Dialyzer warning * unconditionally enable info fil * clean-up inconsistencies * use term_to_binary compression * use try...catch instead of case...catch...of * do not write build info file if the graph is unmodified * store info file as <base_dir>/.rebarinfo * properly support list of compile directives * fix regressions: - Fix a bug in handling of files to compile first. - If a file that is depended upon itself depends on other files, make sure those are compiled first. While at it, rename variables for correctness. Reported-by: David Robakowski - Make sure that FirstFiles has no dupes and preserves the proper order. - headers referenced via -include_lib() were not properly resolved to absolute filenames - .erl files found in sub dirs of src_dirs were not properly resolved to absolute filenames
Thank you. I will look at this today. |
Speed up the compilation process v5
Test suite included in #242. |
Sames as #113 except:
<base_dir>/.rebarinfo
<base_dir>/.rebar/
and storing erlc build info there