Compile only changed?

0 views
Skip to first unread message

David King

unread,
Nov 15, 2007, 9:28:27 PM11/15/07
to erlyweb
Compiling with erlyweb:compile(Appdir,...) takes quite some time, and
compiling with {auto_compile,true} makes every request take a while,
so is there some way to get to the "compile all of the changed files"
functionality directly?

Yariv Sadan

unread,
Nov 16, 2007, 1:29:26 AM11/16/07
to erl...@googlegroups.com
You can pass the {last_compile_time, Time} option to
erlyweb:compile(), and it will only compile the files that have
changed since that time (for convenience, erlyweb:compile() returns
the Time value after each compilation).

Is {auto_compile, true} slow for you? I haven't noticed its impact.

Yariv

Roberto Saccon

unread,
Nov 16, 2007, 2:27:27 AM11/16/07
to erlyweb
If I remember properly, I once had a such a situation, where it can
get slow, if you have a lot of static files served (or better: passed
through) by Erlyweb, then you also have a lot of requests per page,
which are going to be checked whether it is something to recompile,
end erlyweb is printing for each file a warning to the interactive
shell, which is also slow (but can be suppressed I think).

David King

unread,
Nov 16, 2007, 12:12:24 PM11/16/07
to erl...@googlegroups.com
> You can pass the {last_compile_time, Time} option to
> erlyweb:compile(), and it will only compile the files that have
> changed since that time (for convenience, erlyweb:compile() returns
> the Time value after each compilation).

Since obviously {auto_compile,true} already retrieves its last
compile time from somewhere, can we get a {last_compile_time,auto} or
something in a future release?

> Is {auto_compile, true} slow for you? I haven't noticed its impact.

Yes, it at least triples the access time for pages when no files
require re-compiling (of course the impact is more when there are
files that do need compiling, but that's expected). Roberto mentioned
that this could be due to lots of static files, but that's not the
case here; I only have one .js and one .css being served in addition
to the rendered pages.

Yariv Sadan

unread,
Nov 17, 2007, 7:52:19 PM11/17/07
to erl...@googlegroups.com
On Nov 16, 2007 9:12 AM, David King <dk...@ketralnis.com> wrote:
>
> > You can pass the {last_compile_time, Time} option to
> > erlyweb:compile(), and it will only compile the files that have
> > changed since that time (for convenience, erlyweb:compile() returns
> > the Time value after each compilation).
>
> Since obviously {auto_compile,true} already retrieves its last
> compile time from somewhere, can we get a {last_compile_time,auto} or
> something in a future release?

That's a good suggestion. I'll do it.

Yariv

David King

unread,
Nov 17, 2007, 8:34:10 PM11/17/07
to erl...@googlegroups.com
> On Nov 16, 2007 9:12 AM, David King <dk...@ketralnis.com> wrote:
>>> You can pass the {last_compile_time, Time} option to
>>> erlyweb:compile(), and it will only compile the files that have
>>> changed since that time (for convenience, erlyweb:compile() returns
>>> the Time value after each compilation).
>> Since obviously {auto_compile,true} already retrieves its last
>> compile time from somewhere, can we get a {last_compile_time,auto} or
>> something in a future release?
> That's a good suggestion. I'll do it.

Thanks. Do you have a trac or bugzilla or something somewhere? Can I
get an account on it?

Yariv Sadan

unread,
Nov 17, 2007, 8:48:10 PM11/17/07
to erl...@googlegroups.com
>
> Thanks. Do you have a trac or bugzilla or something somewhere? Can I
> get an account on it?

The Google Code project has a bug tracker, but I don't use it. Maybe
it's a good time to start :)

Yariv

David King

unread,
Nov 17, 2007, 9:16:02 PM11/17/07
to erl...@googlegroups.com

Agreed. I'm willing to work on the stuff I'm asking for, but I don't
want to duplicate the work where you've already started

Yariv Sadan

unread,
Nov 18, 2007, 5:38:13 PM11/18/07
to erl...@googlegroups.com
I haven't started yet, so you can go ahead. Just let me know exactly
what it is you're working on so I don't work on the same stuff.

Yariv Sadan

unread,
Nov 18, 2007, 11:44:02 PM11/18/07
to erl...@googlegroups.com
> > Is {auto_compile, true} slow for you? I haven't noticed its impact.
>
> Yes, it at least triples the access time for pages when no files
> require re-compiling (of course the impact is more when there are
> files that do need compiling, but that's expected). Roberto mentioned
> that this could be due to lots of static files, but that's not the
> case here; I only have one .js and one .css being served in addition
> to the rendered pages.

Wow... I guess I made a n00b mistake on Vimagi by setting
{auto_compile, true}. I just removed it and the site feels much
snappier -- almost as fast as BeerRiot, in fact :) Thanks for the tip.

Yariv

David King

unread,
Nov 19, 2007, 11:37:15 AM11/19/07
to erl...@googlegroups.com
> I haven't started yet, so you can go ahead. Just let me know exactly
> what it is you're working on so I don't work on the same stuff.

I'll start on the {last_compile,auto}

Reply all
Reply to author
Forward
0 new messages