[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Typol Execution



I discovered an to me unknown delay in function performance:

In a particular example it takes 12 seconds from the triggering of the
function until the function result appears in the window.

  2 Seconds are needed to calculate the function result
  It is the time from triggering the function until the message
  "Menu calculation done." appears.
  I use the following export clause:

  export CALC_MENU(|- state => menu) & prmess("reports", "SLOTOS", 5)
         as calc_menu(state) = menu;


  2 Seconds are needed to put the function result into the editor
  and redisplay the editor window (The result is a list of 64 entries).

  Therefore about 8 seconds are lost between proofing the export
  clause and returning to LISP.

During my investigations i modified the interface-file for the
menu function:

(de #:menu:calc_menu (state)
  (print "Before Prolog")
  (let ((res ()))
    (#:prolog:quietsend 
      (catenate "'menu$calc_menu$'("(#:PSP:loc state) ").")
    )
    (print "After Prolog")
    res
  )
)

The track of events looks like:

Event					Time

Triggering function			 0 sec
console: "Before Prolog"		 0 sec
console: "Menu calculation done."	 2 sec
console: "After Prolog"			10 sec
Result window updated			12 sec

I would like to know what happens between the finishing of the proof
and returning to the LISP function.
(It is not a LISP-Garbagecollection, i get a message if one really interferes)
Does the PROLOG Interprete need time to recover from the proof?

If i change the "(#:prolog:quietsend" into "(#:prolog:send" the
console output looks like:

--------------------------------------------------
Before Prolog
1/menu$calc_menu$($PSP$cons($PSP$sint(479), $PSP$sint(-26632)))
Menu calculation done.

$STATE$s_instance($STATE$s_par($STATE$s_instance($STATE$s_choice($STATE$s_behaviour($STATE$behaviour($SLOTOS$prefix($SLOTOS$identifier(a),
...
label_map(nil))) ~= _s_stop_1342,
true.
After Prolog
--------------------------------------------------
The strange output of a variable or whatever only happens if i import
the predicate "appendtree(_,_,_)" from prolog.
If i specify "appendtree" in TYPOL myself there is no output but i
get the same delay mentioned before.

Please let me know what is happening in the PROLOG world and why the
usage of a PROLOG primitive causes such console output.

	Thomas

PS: "appendtree" seems to be defined with normal PROLOG clauses,
rather than beeing a primitive, that does surgeory with the list, to
append them. Is there such a fast primitive?