[m-dev.] For review: another change to the external debugger

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon Jul 27 18:38:13 AEST 1998


> > this test is very expensive (11 attributes times possibly millions of
> > events)
> 
> This is wrong; the test is not very expensive.
> The 11 tests are done only only after each request on the socket,
> not for every event.
> Sending things across the socket is far more expensive than a test.
> (If you're sending millions of requests across the socket, then
> a few million tests won't make a significant difference.)

The cost of sending something across is a socket has two parts, (1) the
cost of the operating system calls and context switches involved and (2)
the cost of copying the data. For the non-argument attributes, (1) is
far bigger than (2). Therefore Erwan's proposed change does not incur
any significant cost, and in fact can yield even bigger benefits than
his mail mentioned. Compare

[deb -> mercury] current(yes, yes, yes, yes, yes, yes, yes, yes, yes, yes). 
[mercury -> deb] current(yes(3), yes(3), yes(2), yes(exit), yes("module_name"),
yes("pred_name"), yes(3), yes(0), yes(0), yes("")).

against

[deb -> mercury] current_slots. 
[mercury -> deb] current_slot(3, 3, 2, exit, "module_name", "pred_name",
3, 0, 0, "").

Together with the elimination of the tests, his proposal should yield
a small net win.

> If the size is roughly the same, then I would not consider it worth
> making this change -- after all your change makes the interface
> a bit less orthogonal (i.e. more complicated).

I think the proposed change makes the interface somewhat simpler, not more
complicated, and it should make much of the debugger's code *significantly*
simpler, since it will eliminate the need for any code that tries to optimize
the set of non-argument fields to be transmitted across the socket.
The argument fields are of unbounded size and often large, which means that
trying to minimize their transmission across the socket is worthwhile;
the non-argument fields are of bounded size and always small, which means
that trying to minimize their transmission is not worthwhile.

Zoltan.



More information about the developers mailing list