Skip to content
This repository has been archived by the owner on May 12, 2018. It is now read-only.

Speed up the compilation process #113

Closed
wants to merge 1 commit into from

Conversation

zinid
Copy link

@zinid zinid commented Jul 1, 2013

  • 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'.

* 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'.
@ghost
Copy link

ghost commented Jul 1, 2013

Thanks @zinid, I'd like to ask some questions:

  • Why didn't you enable keep_build_info by default? Is there a known issue?
  • Do you have reproducible performance figures for comparison? Did you test a particular project?

@zinid
Copy link
Author

zinid commented Jul 1, 2013

@Tuncer

  • No known issues. I'm thinking, probably, this feature should be set from a command line as this option is intended at developers mostly.
  • ejabberd. After we replaced the build system with rebar the compilaton process became quite slow. I detect 2-fold speed-up with my patch: from 8 seconds to 4 seconds. Not much, this is just a consequence of removing redundant epp_dodger parsing. If 'keep_build_info' is enabled, it takes less than a second.

@zinid
Copy link
Author

zinid commented Jul 1, 2013

Ah, btw, the way I measured the compile time was:

timer:tc(rebar, main, [["skip_deps=true", "compile"]]).

@ghost
Copy link

ghost commented Jul 1, 2013

What about adding a version marker and using the file for different purposes in the future?

@zinid
Copy link
Author

zinid commented Jul 1, 2013

Yes, storing version marker is a good idea.
As for different files for different purposes or one-for-all file: I don't know. It's always possible to write a converter if we have a version tag though.

fun(Erl) ->
update_graph(G, Erl, include_path(Erl, Config))
end, Erls),
store_graph(G, "ebin", KeepGraph),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should match 'ok' here or else Dialyzer will complain.

@ghost
Copy link

ghost commented Jul 1, 2013

@zinid, generally speaking I like the patch. Thanks a lot!

@ghost
Copy link

ghost commented Aug 16, 2013

@zinid, @dizzyd, ping?

@Vagabond
Copy link
Contributor

Vagabond commented Mar 5, 2014

Closing, because it was subsumed by #129

@Vagabond Vagabond closed this Mar 5, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants