From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 17 Jan 2011 15:00:25 +0000 Message-ID: From: Robert Raschke To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=001485eba90e41ec31049a0c0b31 Subject: Re: [9fans] `mk` (from Plan9 ports) efficiency related issue Topicbox-Message-UUID: 9c93feb0-ead6-11e9-9d60-3106f5b1d025 --001485eba90e41ec31049a0c0b31 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Terribly sorry, my email won't help you much, apart from going "Wow, a 4000 link mk file!" and "Hmm, I wouldn't start from here if you want to go there." Your email also doesn't explain why you cannot generate a "normal" mk file. If you want to stick with your approach, it almost looks like you may be better off to generate a shell script that explicitly checks and runs everything you need. (And yes, essentially make your "generator" be a make in it's own right. Another one won't hurt.) But it's cool to see someone else who uses Erlang and RabbitMQ hanging out on this list. :-) Robby On Mon, Jan 17, 2011 at 2:47 PM, Ciprian Dorin Craciun < ciprian.craciun@gmail.com> wrote: > Hello all! > > Sorry for interrupting again, but I've stumbled on an `mk` issue... > > I've written a little Scheme application that generates `mk` > scripts for building Erlang applications. (See below an extract of one > of my previous emails describing just the generator part; the thread > had the subject: < issue?>>.) > > Now the problem is that the generated script (attached to this > email) has about 2671 prerequisites (` target :: prerequisite `), and > about 684 actual targets with recipes. (As I've explained below I'm > not using any meta-rules, and I'm explicit about each resulting file > and it's dependencies.) > > The problem is that the time needed to run the script has > extremely increased, and the processor is 100% eaten by `mk`. > > For example: > * just running the `mk` script with the `-n` option takes about 14 > seconds. > * using the commands from the `mk -n` takes about 1 minute and 36 > seconds; > * then running `mk` takes another 14 seconds; (as it has nothing); > * but after cleaning and running `mk` (which I've left running for > about 5 minutes and still didn't finished) it seems that between each > target (or batch of targets?) it stays about 14 seconds; > > But what is strange is that if instead to build the default target > that builds everything I start building little by little independent > parts, it works without that great delay... > > Any ideas what could cause this? > > Thanks, > Ciprian. > > > ---------- > [[ Extract from the previous email. ]] > ---------- > > BTW... People might wonder how come I have 367 targets (with 1221 > prerequisites) for such a small project? :) The answers is I don't > write the `mk` script by hand, but I've written a small Scheme > application that just generates the `mk` script based on descriptions > like the following. (Thus the resulting `mk` script is quite > exhaustive with quite tight dependencies and doesn't use > meta-rules...) :) > > So just out of curiosity are there any `mk` script generators out there= ? > > Ciprian. > > > ~~~~ > (vbs:require-erlang) > > (vbs:define-erlang-application 'rabbit > erl: "\\./(rabbitmq-server--latest/src|generated)/.*\\.erl" > hrl: "\\./(rabbitmq-server--latest/include|generated)/.*\\.hrl" > additional-ebin: "\\./generated/rabbit\\.app") > > (vbs:define-erlang-application 'rabbit_common > erl: > "\\./(rabbitmq-server--latest/src|generated)/(rabbit_writer|rabbit_reader= |rabbit_framing_amqp_0_8|rabbit_framing_amqp_0_9_1|rabbit_framing_channel|r= abbit_basic|rabbit_binary_generator|rabbit_binary_parser|rabbit_channel|rab= bit_exchange_type|rabbit_misc|rabbit_net|rabbit_heartbeat|rabbit_msg_store_= index|gen_server2|priority_queue|supervisor2)\\.erl" > hrl: "\\./(rabbitmq-server--latest/include|generated)/.*\\.hrl" > additional-ebin: "\\./generated/rabbit_common\\.app") > > (vbs:define-erlang-application 'amqp_client > dependencies: 'rabbit_common > erl: "\\./rabbitmq-erlang-client--latest/src/.*\\.erl" > hrl: "\\./rabbitmq-erlang-client--latest/include/.*\\.hrl" > additional-ebin: "\\./generated/amqp_client\\.app") > ~~~~ > --001485eba90e41ec31049a0c0b31 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Terribly sorry, my email won't help you much, apart from going "Wo= w, a 4000 link mk file!" and "Hmm, I wouldn't start from here= if you want to go there." Your email also doesn't explain why you= cannot generate a "normal" mk file.

If you want to stick with your approach, it almost looks like you may b= e better off to generate a shell script that explicitly checks and runs eve= rything you need. (And yes, essentially make your "generator" be = a make in it's own right. Another one won't hurt.)

But it's cool to see someone else who uses Erlang and RabbitMQ hang= ing out on this list. :-)

Robby

On= Mon, Jan 17, 2011 at 2:47 PM, Ciprian Dorin Craciun <= ciprian.craciun@gmail.com&= gt; wrote:
=C2=A0 =C2=A0Hel= lo all!

=C2=A0 =C2=A0Sorry for interrupting again, but I've stumbled on an `mk= ` issue...

=C2=A0 =C2=A0I've written a little Scheme application that generates `= mk`
scripts for building Erlang applications. (See below an extract of one
of my previous emails describing just the generator part; the thread
had the subject: <<mk (from plan9ports) modification time resolution<= br> issue?>>.)

=C2=A0 =C2=A0Now the problem is that the generated script (attached to thi= s
email) has about 2671 prerequisites (` target :: prerequisite `), and
about 684 actual targets with recipes. (As I've explained below I'm=
not using any meta-rules, and I'm explicit about each resulting file and it's dependencies.)

=C2=A0 =C2=A0The problem is that the time needed to run the script has
extremely increased, and the processor is 100% eaten by `mk`.

=C2=A0 =C2=A0For example:
=C2=A0 =C2=A0* just running the `mk` script with the `-n` option takes abo= ut 14 seconds.
=C2=A0 =C2=A0* using the commands from the `mk -n` takes about 1 minute an= d 36 seconds;
=C2=A0 =C2=A0* then running `mk` takes another 14 seconds; (as it has noth= ing);
=C2=A0 =C2=A0* but after cleaning and running `mk` (which I've left ru= nning for
about 5 minutes and still didn't finished) it seems that between each target (or batch of targets?) it stays about 14 seconds;

=C2=A0 =C2=A0But what is strange is that if instead to build the default t= arget
that builds everything I start building little by little independent
parts, it works without that great delay...

=C2=A0 =C2=A0Any ideas what could cause this?

=C2=A0 =C2=A0Thanks,
=C2=A0 =C2=A0Ciprian.


----------
[[ Extract from the previous email. ]]
----------

=C2=A0 BTW... People might wonder how come I have 367 targets (with 1221 prerequisites) for such a small project? :) The answers is I don't
write the `mk` script by hand, but I've written a small Scheme
application that just generates the `mk` script based on descriptions
like the following. (Thus the resulting `mk` script is quite
exhaustive with quite tight dependencies and doesn't use
meta-rules...) :)

=C2=A0 So just out of curiosity are there any `mk` script generators out t= here?

=C2=A0 Ciprian.


~~~~
(vbs:require-erlang)

(vbs:define-erlang-application 'rabbit
=C2=A0 =C2=A0 =C2=A0 erl: "\\./(rabbitmq-server--latest/src|generated= )/.*\\.erl"
=C2=A0 =C2=A0 =C2=A0 hrl: "\\./(rabbitmq-server--latest/include|gener= ated)/.*\\.hrl"
=C2=A0 =C2=A0 =C2=A0 additional-ebin: "\\./generated/rabbit\\.app&quo= t;)

(vbs:define-erlang-application 'rabbit_common
=C2=A0 =C2=A0 =C2=A0 erl: "\\./(rabbitmq-server--latest/src|generated= )/(rabbit_writer|rabbit_reader|rabbit_framing_amqp_0_8|rabbit_framing_amqp_= 0_9_1|rabbit_framing_channel|rabbit_basic|rabbit_binary_generator|rabbit_bi= nary_parser|rabbit_channel|rabbit_exchange_type|rabbit_misc|rabbit_net|rabb= it_heartbeat|rabbit_msg_store_index|gen_server2|priority_queue|supervisor2)= \\.erl"
=C2=A0 =C2=A0 =C2=A0 hrl: "\\./(rabbitmq-server--latest/include|gener= ated)/.*\\.hrl"
=C2=A0 =C2=A0 =C2=A0 additional-ebin: "\\./generated/rabbit_common\\.= app")

(vbs:define-erlang-application 'amqp_client
=C2=A0 =C2=A0 =C2=A0 dependencies: 'rabbit_common
=C2=A0 =C2=A0 =C2=A0 erl: "\\./rabbitmq-erlang-client--latest/src/.*\= \.erl"
=C2=A0 =C2=A0 =C2=A0 hrl: "\\./rabbitmq-erlang-client--latest/include= /.*\\.hrl"
=C2=A0 =C2=A0 =C2=A0 additional-ebin: "\\./generated/amqp_client\\.ap= p")
~~~~

--001485eba90e41ec31049a0c0b31--