load_files/2performance

View: New views
5 Messages — Rating Filter:   Alert me  

load_files/2performance

by jos.deroo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

We make use of load_files([F],[compilation_mode(assert_all)])
and it appeared to us that it could take a long time for some cases
so I made a test file like

p0(s,o).
p1(s,o).
p2(s,o).
p3(s,o).
p4(s,o).
p5(s,o).
p6(s,o).
p7(s,o).
p8(s,o).
p9(s,o).
p10(s,o).
p11(s,o).
p12(s,o).
...
p99999(s,o).

and ran

time yap -g "load_files(['gen100000.yap'],[compilation_mode(assert_all)]),halt"
% Restoring file /usr/local/lib/Yap/startup.yss
YAP version Yap-6.0.0
 % reconsulting /home/jdroo/temp/gen100000.yap...
 % reconsulted /home/jdroo/temp/gen100000.yap in module user, 728297 msec 32995232 bytes
% YAP execution halted

real        12m9.012s
user        12m8.370s
sys        0m0.512s


which is more than 1000 times slower than


time yap -g "['gen100000.yap'],halt"
% Restoring file /usr/local/lib/Yap/startup.yss
YAP version Yap-6.0.0
 % consulting /home/jdroo/temp/gen100000.yap...
 % consulted /home/jdroo/temp/gen100000.yap in module user, 664 msec 19792048 bytes
% YAP execution halted

real        0m0.682s
user        0m0.668s
sys        0m0.012s



Kind regards,

Jos De Roo | Agfa HealthCare
Senior Researcher | HE/Advanced Clinical Applications Research
T  +32 3444 7618
http://www.agfa.com/w3c/jdroo/

Quadrat NV, Kortrijksesteenweg 157, 9830 Sint-Martens-Latem, Belgium
http://www.agfa.com/healthcare
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Yap-users mailing list
Yap-users@...
https://lists.sourceforge.net/lists/listinfo/yap-users

Re: load_files/2performance

by jos.deroo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A small test with following change

diff --git a/pl/boot.yap b/pl/boot.yap
index b76559a..1e354ac 100644
--- a/pl/boot.yap
+++ b/pl/boot.yap
@@ -440,7 +440,7 @@ true :- true.
         recorded('$reconsulted',X,_),
         ( X = N/A , !;
           X = '$', !, fail;
-          fail
+          !, fail
         ).
 
 '$inform_as_reconsulted'(N,A) :-

now gives

time yap -g "load_files(['gen100000.yap'],[compilation_mode(assert_all)]),halt"
% Restoring file /usr/local/lib/Yap/startup.yss
YAP version Yap-6.0.0
 % reconsulting /home/jdroo/temp/gen100000.yap...
 % reconsulted /home/jdroo/temp/gen100000.yap in module user, 1080 msec 32995232 bytes
% YAP execution halted

real        0m1.195s
user        0m1.164s
sys        0m0.032s


which is (728297/1080-1)*100 = 67335 percent faster
and all our test cases are now happy :-)

Kind regards,

Jos De Roo | Agfa HealthCare
Senior Researcher | HE/Advanced Clinical Applications Research
T  +32 3444 7618
http://www.agfa.com/w3c/jdroo/

Quadrat NV, Kortrijksesteenweg 157, 9830 Sint-Martens-Latem, Belgium
http://www.agfa.com/healthcare


Jos De Roo/AMDUS/AGFA@AGFA

09/13/2009 02:24 PM

To
yap-users@...
cc
Subject
[Yap-users] load_files/2performance






We make use of load_files([F],[compilation_mode(assert_all)])
and it appeared to us that it could take a long time for some cases

so I made a test file like


p0(s,o).

p1(s,o).

p2(s,o).

p3(s,o).

p4(s,o).

p5(s,o).

p6(s,o).

p7(s,o).

p8(s,o).

p9(s,o).

p10(s,o).

p11(s,o).

p12(s,o).

...

p99999(s,o).


and ran


time yap -g "load_files(['gen100000.yap'],[compilation_mode(assert_all)]),halt"

% Restoring file /usr/local/lib/Yap/startup.yss

YAP version Yap-6.0.0

% reconsulting /home/jdroo/temp/gen100000.yap...

% reconsulted /home/jdroo/temp/gen100000.yap in module user, 728297 msec 32995232 bytes

% YAP execution halted


real        12m9.012s

user        12m8.370s

sys        0m0.512s



which is more than 1000 times slower than



time yap -g "['gen100000.yap'],halt"

% Restoring file /usr/local/lib/Yap/startup.yss

YAP version Yap-6.0.0

% consulting /home/jdroo/temp/gen100000.yap...

% consulted /home/jdroo/temp/gen100000.yap in module user, 664 msec 19792048 bytes

% YAP execution halted


real        0m0.682s

user        0m0.668s

sys        0m0.012s




Kind regards,

Jos De Roo | Agfa HealthCare
Senior Researcher | HE/Advanced Clinical Applications Research
T  +32 3444 7618

http://www.agfa.com/w3c/jdroo/

Quadrat NV, Kortrijksesteenweg 157, 9830 Sint-Martens-Latem, Belgium

http://www.agfa.com/healthcare
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  
http://p.sf.net/sfu/bobj-july
_______________________________________________
Yap-users mailing list
Yap-users@...
https://lists.sourceforge.net/lists/listinfo/yap-users



------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Yap-users mailing list
Yap-users@...
https://lists.sourceforge.net/lists/listinfo/yap-users

Parent Message unknown Re: load_files/2performance

by jos.deroo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

the test was small and my thinking even smaller.. :-)
this might be better

'$check_if_reconsulted'(N,A) :-
         ( recorded('$reconsulted',N/A,_) ->
           recorded('$reconsulted',X,_),
           ( X = N/A , !;
             X = '$', !, fail;
             fail
           )
         ).

and the speed gain is the similar

Kind regards,

Jos De Roo | Agfa HealthCare
Senior Researcher | HE/Advanced Clinical Applications Research
T  +32 3444 7618
http://www.agfa.com/w3c/jdroo/

Quadrat NV, Kortrijksesteenweg 157, 9830 Sint-Martens-Latem, Belgium
http://www.agfa.com/healthcare


Jos De Roo/AMDUS/AGFA

09/19/2009 01:25 PM

To
Jos De Roo/AMDUS/AGFA@AGFA@AGFASMTP
cc
yap-users@...
Subject
Re: [Yap-users] load_files/2performanceLink




A small test with following change

diff --git a/pl/boot.yap b/pl/boot.yap
index b76559a..1e354ac 100644
--- a/pl/boot.yap
+++ b/pl/boot.yap
@@ -440,7 +440,7 @@ true :- true.
         recorded('$reconsulted',X,_),
         ( X = N/A , !;
           X = '$', !, fail;
-          fail
+          !, fail
         ).
 
 '$inform_as_reconsulted'(N,A) :-

now gives

time yap -g "load_files(['gen100000.yap'],[compilation_mode(assert_all)]),halt"
% Restoring file /usr/local/lib/Yap/startup.yss
YAP version Yap-6.0.0
 % reconsulting /home/jdroo/temp/gen100000.yap...
 % reconsulted /home/jdroo/temp/gen100000.yap in module user, 1080 msec 32995232 bytes
% YAP execution halted

real        0m1.195s
user        0m1.164s
sys        0m0.032s


which is (728297/1080-1)*100 = 67335 percent faster
and all our test cases are now happy :-)

Kind regards,

Jos De Roo | Agfa HealthCare
Senior Researcher | HE/Advanced Clinical Applications Research
T  +32 3444 7618
http://www.agfa.com/w3c/jdroo/

Quadrat NV, Kortrijksesteenweg 157, 9830 Sint-Martens-Latem, Belgium
http://www.agfa.com/healthcare


Jos De Roo/AMDUS/AGFA@AGFA

09/13/2009 02:24 PM

To
yap-users@...
cc
Subject
[Yap-users] load_files/2performance






We make use of load_files([F],[compilation_mode(assert_all)])
and it appeared to us that it could take a long time for some cases

so I made a test file like


p0(s,o).

p1(s,o).

p2(s,o).

p3(s,o).

p4(s,o).

p5(s,o).

p6(s,o).

p7(s,o).

p8(s,o).

p9(s,o).

p10(s,o).

p11(s,o).

p12(s,o).

...

p99999(s,o).


and ran


time yap -g "load_files(['gen100000.yap'],[compilation_mode(assert_all)]),halt"

% Restoring file /usr/local/lib/Yap/startup.yss

YAP version Yap-6.0.0

% reconsulting /home/jdroo/temp/gen100000.yap...

% reconsulted /home/jdroo/temp/gen100000.yap in module user, 728297 msec 32995232 bytes

% YAP execution halted


real        12m9.012s

user        12m8.370s

sys        0m0.512s



which is more than 1000 times slower than



time yap -g "['gen100000.yap'],halt"

% Restoring file /usr/local/lib/Yap/startup.yss

YAP version Yap-6.0.0

% consulting /home/jdroo/temp/gen100000.yap...

% consulted /home/jdroo/temp/gen100000.yap in module user, 664 msec 19792048 bytes

% YAP execution halted


real        0m0.682s

user        0m0.668s

sys        0m0.012s




Kind regards,

Jos De Roo | Agfa HealthCare
Senior Researcher | HE/Advanced Clinical Applications Research
T  +32 3444 7618

http://www.agfa.com/w3c/jdroo/

Quadrat NV, Kortrijksesteenweg 157, 9830 Sint-Martens-Latem, Belgium

http://www.agfa.com/healthcare
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  
http://p.sf.net/sfu/bobj-july
_______________________________________________
Yap-users mailing list
Yap-users@...
https://lists.sourceforge.net/lists/listinfo/yap-users




------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Yap-users mailing list
Yap-users@...
https://lists.sourceforge.net/lists/listinfo/yap-users

Re: load_files/2performance

by Vítor Santos Costa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jos

First, my apologies to everyone. The last few weeks have been tough, I have been unable to do much for YAP :(


the test was small and my thinking even smaller.. :-)
this might be better

'$check_if_reconsulted'(N,A) :-
         ( recorded('$reconsulted',N/A,_) ->
           recorded('$reconsulted',X,_),
           ( X = N/A , !;
             X = '$', !, fail;
             fail
           )
         ).

and the speed gain is the similar


It looks correct, and if the predicates are contiguous will be efficient. It would be nicer to add the file name to the stack, but this will work.

Thanks!

Vitor

Kind regards,

Jos De Roo | Agfa HealthCare
Senior Researcher | HE/Advanced Clinical Applications Research
T  +32 3444 7618
http://www.agfa.com/w3c/jdroo/

Quadrat NV, Kortrijksesteenweg 157, 9830 Sint-Martens-Latem, Belgium
http://www.agfa.com/healthcare


Jos De Roo/AMDUS/AGFA

09/19/2009 01:25 PM

To
Jos De Roo/AMDUS/AGFA@AGFA@AGFASMTP
cc
yap-users@...
Subject
Re: [Yap-users] load_files/2performanceLink




A small test with following change

diff --git a/pl/boot.yap b/pl/boot.yap
index b76559a..1e354ac 100644
--- a/pl/boot.yap
+++ b/pl/boot.yap
@@ -440,7 +440,7 @@ true :- true.
         recorded('$reconsulted',X,_),
         ( X = N/A , !;
           X = '$', !, fail;
-          fail
+          !, fail
         ).
 
 '$inform_as_reconsulted'(N,A) :-

now gives

time yap -g "load_files(['gen100000.yap'],[compilation_mode(assert_all)]),halt"
% Restoring file /usr/local/lib/Yap/startup.yss
YAP version Yap-6.0.0
 % reconsulting /home/jdroo/temp/gen100000.yap...
 % reconsulted /home/jdroo/temp/gen100000.yap in module user, 1080 msec 32995232 bytes
% YAP execution halted

real        0m1.195s
user        0m1.164s
sys        0m0.032s


which is (728297/1080-1)*100 = 67335 percent faster
and all our test cases are now happy :-)

Kind regards,

Jos De Roo | Agfa HealthCare
Senior Researcher | HE/Advanced Clinical Applications Research
T  +32 3444 7618
http://www.agfa.com/w3c/jdroo/

Quadrat NV, Kortrijksesteenweg 157, 9830 Sint-Martens-Latem, Belgium
http://www.agfa.com/healthcare


Jos De Roo/AMDUS/AGFA@AGFA

09/13/2009 02:24 PM

To
yap-users@...
cc
Subject
[Yap-users] load_files/2performance






We make use of load_files([F],[compilation_mode(assert_all)])
and it appeared to us that it could take a long time for some cases

so I made a test file like


p0(s,o).

p1(s,o).

p2(s,o).

p3(s,o).

p4(s,o).

p5(s,o).

p6(s,o).

p7(s,o).

p8(s,o).

p9(s,o).

p10(s,o).

p11(s,o).

p12(s,o).

...

p99999(s,o).


and ran


time yap -g "load_files(['gen100000.yap'],[compilation_mode(assert_all)]),halt"

% Restoring file /usr/local/lib/Yap/startup.yss

YAP version Yap-6.0.0

% reconsulting /home/jdroo/temp/gen100000.yap...

% reconsulted /home/jdroo/temp/gen100000.yap in module user, 728297 msec 32995232 bytes

% YAP execution halted


real        12m9.012s

user        12m8.370s

sys        0m0.512s



which is more than 1000 times slower than



time yap -g "['gen100000.yap'],halt"

% Restoring file /usr/local/lib/Yap/startup.yss

YAP version Yap-6.0.0

% consulting /home/jdroo/temp/gen100000.yap...

% consulted /home/jdroo/temp/gen100000.yap in module user, 664 msec 19792048 bytes

% YAP execution halted


real        0m0.682s

user        0m0.668s

sys        0m0.012s




Kind regards,

Jos De Roo | Agfa HealthCare
Senior Researcher | HE/Advanced Clinical Applications Research
T  +32 3444 7618

http://www.agfa.com/w3c/jdroo/

Quadrat NV, Kortrijksesteenweg 157, 9830 Sint-Martens-Latem, Belgium

http://www.agfa.com/healthcare
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  
http://p.sf.net/sfu/bobj-july
_______________________________________________
Yap-users mailing list
Yap-users@...
https://lists.sourceforge.net/lists/listinfo/yap-users



------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf_______________________________________________
Yap-users mailing list
Yap-users@...
https://lists.sourceforge.net/lists/listinfo/yap-users


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Yap-users mailing list
Yap-users@...
https://lists.sourceforge.net/lists/listinfo/yap-users

Re: load_files/2performance

by jos.deroo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks very much Vitor for your prompt action!
Life can indeed be tough but let's believe that
the future is longer than the past :)


Kind regards,

Jos De Roo | Agfa HealthCare
Senior Researcher | HE/Advanced Clinical Applications Research
T  +32 3444 7618
http://www.agfa.com/w3c/jdroo/

Quadrat NV, Kortrijksesteenweg 157, 9830 Sint-Martens-Latem, Belgium
http://www.agfa.com/healthcare


Vítor Santos Costa <vsc@...>

09/20/2009 05:01 PM

To
Jos De Roo/AMDUS/AGFA@AGFA
cc
yap-users@...
Subject
Re: [Yap-users] load_files/2performance






Hi Jos

First, my apologies to everyone. The last few weeks have been tough, I have been unable to do much for YAP :(


the test was small and my thinking even smaller.. :-)
this might be better


'$check_if_reconsulted'(N,A) :-

        ( recorded('$reconsulted',N/A,_) ->

          recorded('$reconsulted',X,_),

          ( X = N/A , !;

            X = '$', !, fail;

            fail

          )

        ).


and the speed gain is the similar



It looks correct, and if the predicates are contiguous will be efficient. It would be nicer to add the file name to the stack, but this will work.

Thanks!

Vitor

Kind regards,

Jos De Roo | Agfa HealthCare
Senior Researcher | HE/Advanced Clinical Applications Research
T  +32 3444 7618

http://www.agfa.com/w3c/jdroo/

Quadrat NV, Kortrijksesteenweg 157, 9830 Sint-Martens-Latem, Belgium

http://www.agfa.com/healthcare

Jos De Roo/AMDUS/AGFA

09/19/2009 01:25 PM


To
Jos De Roo/AMDUS/AGFA@AGFA@AGFASMTP
cc
yap-users@...
Subject
Re: [Yap-users] load_files/2performanceLink






A small test with following change


diff --git a/pl/boot.yap b/pl/boot.yap

index b76559a..1e354ac 100644

--- a/pl/boot.yap

+++ b/pl/boot.yap

@@ -440,7 +440,7 @@ true :- true.

        recorded('$reconsulted',X,_),

        ( X = N/A , !;

          X = '$', !, fail;

-          fail

+          !, fail

        ).

 
'$inform_as_reconsulted'(N,A) :-


now gives


time yap -g "load_files(['gen100000.yap'],[compilation_mode(assert_all)]),halt"

% Restoring file /usr/local/lib/Yap/startup.yss

YAP version Yap-6.0.0

% reconsulting /home/jdroo/temp/gen100000.yap...

% reconsulted /home/jdroo/temp/gen100000.yap in module user, 1080 msec 32995232 bytes

% YAP execution halted


real        0m1.195s

user        0m1.164s

sys        0m0.032s



which is (728297/1080-1)*100 = 67335 percent faster

and all our test cases are now happy :-)


Kind regards,

Jos De Roo | Agfa HealthCare
Senior Researcher | HE/Advanced Clinical Applications Research
T  +32 3444 7618

http://www.agfa.com/w3c/jdroo/

Quadrat NV, Kortrijksesteenweg 157, 9830 Sint-Martens-Latem, Belgium

http://www.agfa.com/healthcare

Jos De Roo/AMDUS/AGFA@AGFA

09/13/2009 02:24 PM


To
yap-users@...
cc
Subject
[Yap-users] load_files/2performance








We make use of load_files([F],[compilation_mode(assert_all)])

and it appeared to us that it could take a long time for some cases

so I made a test file like


p0(s,o).

p1(s,o).

p2(s,o).

p3(s,o).

p4(s,o).

p5(s,o).

p6(s,o).

p7(s,o).

p8(s,o).

p9(s,o).

p10(s,o).

p11(s,o).

p12(s,o).

...

p99999(s,o).


and ran


time yap -g "load_files(['gen100000.yap'],[compilation_mode(assert_all)]),halt"

% Restoring file /usr/local/lib/Yap/startup.yss

YAP version Yap-6.0.0

% reconsulting /home/jdroo/temp/gen100000.yap...

% reconsulted /home/jdroo/temp/gen100000.yap in module user, 728297 msec 32995232 bytes

% YAP execution halted


real        12m9.012s

user        12m8.370s

sys        0m0.512s



which is more than 1000 times slower than



time yap -g "['gen100000.yap'],halt"

% Restoring file /usr/local/lib/Yap/startup.yss

YAP version Yap-6.0.0

% consulting /home/jdroo/temp/gen100000.yap...

% consulted /home/jdroo/temp/gen100000.yap in module user, 664 msec 19792048 bytes

% YAP execution halted


real        0m0.682s

user        0m0.668s

sys        0m0.012s




Kind regards,

Jos De Roo | Agfa HealthCare
Senior Researcher | HE/Advanced Clinical Applications Research
T  +32 3444 7618

http://www.agfa.com/w3c/jdroo/

Quadrat NV, Kortrijksesteenweg 157, 9830 Sint-Martens-Latem, Belgium

http://www.agfa.com/healthcare
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  
http://p.sf.net/sfu/bobj-july
_______________________________________________
Yap-users mailing list

Yap-users@...
https://lists.sourceforge.net/lists/listinfo/yap-users



------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;

http://p.sf.net/sfu/devconf_______________________________________________
Yap-users mailing list
Yap-users@...
https://lists.sourceforge.net/lists/listinfo/yap-users



------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Yap-users mailing list
Yap-users@...
https://lists.sourceforge.net/lists/listinfo/yap-users