Erlang Mailing Lists

Author Message

<  Erlang patches mailing list  ~  load native code for early modules

Guest
Posted: Wed Jul 28, 2010 7:03 am Reply with quote
Guest
On Sun, Jul 11, 2010 at 8:00 PM, Paul Guyot <pguyot@kallisys.net> wrote:
> The native chunks of modules loaded before the code server are never loaded, which makes it pretty pointless to natively compile them in the first place (with --enable-native-libs). A patch that loads them just after the code server is started can be found here:
>
> git fetch git://github.com/pguyot/otp.git pg/load-native-code-for-early-modules
>
> http://github.com/pguyot/otp/commit/2637b8a24e2d9ba3653e580f21a70976915dc201
>
> As a side effect, this patch will decrease the load time of dialyzer on installations configured with --enable-native-libs. Indeed, dialyzer natively recompiles modules including some that were loaded before the code server (such as lists, gb_trees, etc.).
>

Your added code is located in the code_server module,
but it is not executed in the code_server process.

This is confusing for both human readers and a test
case called code_SUITE:ext_mod_dep/1 which attempts
to find unsafe calls in the code_server process.

Therefore, I suggest that you move the code to the 'code'
module (putting the call to load_native_code_for_all_loaded/0
in the do_start/1 function).

Minor style nit: You don't need parenthesis around a catch
unless you want to assign the result to a variable.

--
Björn Gustavsson, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Wed Jul 28, 2010 7:04 am Reply with quote
Guest
On Sun, Jul 11, 2010 at 8:00 PM, Paul Guyot <pguyot@kallisys.net> wrote:
> The native chunks of modules loaded before the code server are never loaded, which makes it pretty pointless to natively compile them in the first place (with --enable-native-libs). A patch that loads them just after the code server is started can be found here:
>
> git fetch git://github.com/pguyot/otp.git pg/load-native-code-for-early-modules
>
> http://github.com/pguyot/otp/commit/2637b8a24e2d9ba3653e580f21a70976915dc201
>
> As a side effect, this patch will decrease the load time of dialyzer on installations configured with --enable-native-libs. Indeed, dialyzer natively recompiles modules including some that were loaded before the code server (such as lists, gb_trees, etc.).
>

Your added code is located in the code_server module,
but it is not executed in the code_server process.

This is confusing for both human readers and a test
case called code_SUITE:ext_mod_dep/1 which attempts
to find unsafe calls in the code_server process.

Therefore, I suggest that you move the code to the 'code'
module (putting the call to load_native_code_for_all_loaded/0
in the do_start/1 function).

Minor style nit: You don't need parenthesis around a catch
unless you want to assign the result to a variable.

--
Björn Gustavsson, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Wed Jul 28, 2010 8:41 am Reply with quote
Guest
Le 28 juil. 2010
Guest
Posted: Wed Jul 28, 2010 8:42 am Reply with quote
Guest
Le 28 juil. 2010
Guest
Posted: Wed Jul 28, 2010 1:37 pm Reply with quote
Guest
2010/7/28 Paul Guyot <pguyot@kallisys.net>:
>
> Thank you for the review!
>
> I have just committed suggested changes here:
> http://github.com/pguyot/otp/commit/a30b889c01cb8cc9e0ad021f41b7ed27cf97fed7
>
> I also added a non-regression test:
> http://github.com/pguyot/otp/commit/5f23082a8d842ca0a414748e011c4b10240c8fcc

I used "git rebase -i" and combined all three commits to one.
(We are not interested in keeping the development history
of a patch.)

I have also updated the test case so that it will be skipped
if the Erlang/OTP does not have hipe support enabled,
and broken some long lines:

http://github.com/erlang/otp/commit/a8b8ec5e858da86531933b545f752f436e411b58

If that is OK to you and if there will be no problems in our
daily builds, I might merge this branch to dev tomorrow.

Can you fix the test cases in pg/fix-hipe-load and pg/hipe_crash_with_on_load
so that they are skipped if the Erlang/OTP system does not have hipe
support enabled?


--
Björn Gustavsson, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Wed Jul 28, 2010 1:37 pm Reply with quote
Guest
2010/7/28 Paul Guyot <pguyot@kallisys.net>:
>
> Thank you for the review!
>
> I have just committed suggested changes here:
> http://github.com/pguyot/otp/commit/a30b889c01cb8cc9e0ad021f41b7ed27cf97fed7
>
> I also added a non-regression test:
> http://github.com/pguyot/otp/commit/5f23082a8d842ca0a414748e011c4b10240c8fcc

I used "git rebase -i" and combined all three commits to one.
(We are not interested in keeping the development history
of a patch.)

I have also updated the test case so that it will be skipped
if the Erlang/OTP does not have hipe support enabled,
and broken some long lines:

http://github.com/erlang/otp/commit/a8b8ec5e858da86531933b545f752f436e411b58

If that is OK to you and if there will be no problems in our
daily builds, I might merge this branch to dev tomorrow.

Can you fix the test cases in pg/fix-hipe-load and pg/hipe_crash_with_on_load
so that they are skipped if the Erlang/OTP system does not have hipe
support enabled?


--
Björn Gustavsson, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Wed Jul 28, 2010 1:55 pm Reply with quote
Guest
2010/7/28 Björn Gustavsson <bgustavsson@gmail.com>:

> Can you fix the test cases in pg/fix-hipe-load and pg/hipe_crash_with_on_load
> so that they are skipped if the Erlang/OTP system does not have hipe
> support enabled?

Thinking a little bit more, I realize that if every test case
in a module should be skipped if a certain condition,
there are better (but non-obvious) ways than to change
every single test case.

So I suggest that you'll wait and I'll have look at how
to best do the skipping tomorrow.


--
Björn Gustavsson, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Wed Jul 28, 2010 1:55 pm Reply with quote
Guest
2010/7/28 Björn Gustavsson <bgustavsson@gmail.com>:

> Can you fix the test cases in pg/fix-hipe-load and pg/hipe_crash_with_on_load
> so that they are skipped if the Erlang/OTP system does not have hipe
> support enabled?

Thinking a little bit more, I realize that if every test case
in a module should be skipped if a certain condition,
there are better (but non-obvious) ways than to change
every single test case.

So I suggest that you'll wait and I'll have look at how
to best do the skipping tomorrow.


--
Björn Gustavsson, Erlang/OTP, Ericsson AB

________________________________________________________________
erlang-patches (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-patches-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Wed Jul 28, 2010 3:27 pm Reply with quote
Guest
Le 28 juil. 2010
Guest
Posted: Wed Jul 28, 2010 3:27 pm Reply with quote
Guest
Le 28 juil. 2010
wailian
Posted: Tue Mar 20, 2012 2:40 am Reply with quote
Guest
The shoes absolutely are an avant-garde day time day admiration and do amazing problems even although access just about any apparel! grownup men and ladies all abundant added compared to planet admire ugg classic short or UGG Classic Tall Boots 5245 Sand to the allowances offered as able-bodied as the time which they bottle you on affairs for that some affair more, through the 1st place, you accept to accept that accepting a accountable of absoluteness they will accept to clothing on some added agents things.

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum