[Ecls-list] Improving CLOS?
Waldek Hebisch
hebisch at math.uni.wroc.pl
Fri Mar 19 04:31:03 UTC 2010
> Waldek Hebisch <hebisch at math.uni.wroc.pl> writes:
>
> > They report (depending on number of parameters) between 218 and 77
> > milions of dispatching calls per second on 2.5 GHz Core 2. That is
> > 11-33 clocks per call. I am affraid that with current call convention
> > ECL has no chance to match that: current ECL indirect call costs
> > about 75 clocks, so even if dispatching cost would be reduced to 0,
> > ECL still would be much slower.
>
> This is surprisingly expensive. Might be a branch prediction miss due to
> the indirect call?
A little correction. The cost as above is at (default) safety 2.
At safety 0 it drops to 21.29 clocks per call. I intended to
compile at safety 0, because this is relevant to CLOS calls,
but somewhat the ECL version I used (labeled 10.2.1) ignored
optimization proclaim and compiled at default safety anyway
(I will check if the same happens with 10.3.1 and trunk).
The 75 clocks is mostly due to performing basic operations
(like aref, car, cdr) which are supposed to be very cheap
via calls to library functions. The 21.29 clocks includes
misprediction time, but also 46.69 instructions per call,
so actual cost of mispredictions seem to be quite low.
Below oprofile report if that helps:
clocks % instructions % library routine
3763 25.2737 2648 17.9952 libecl.so.10.2.1 dispatch2
1749 11.7469 2642 17.9545 ECL3NBhsP L6do_it
1488 9.9940 1282 8.7122 libecl.so.10.2.1 ecl_number_compare
1433 9.6246 1108 7.5297 ECL3NBhsP L4op1
1375 9.2350 1580 10.7373 ECL3NBhsP L5op2
727 4.8828 1731 11.7635 libecl.so.10.2.1 ecl_to_fixnum
670 4.5000 684 4.6483 libecl.so.10.2.1 ecl_one_plus
559 3.7544 598 4.0639 ECL3NBhsP L3op0
540 3.6268 1133 7.6996 ECL3NBhsP .plt
379 2.5455 496 3.3707 libecl.so.10.2.1 fixint
91 0.6112 107 0.7271 libecl.so.10.2.1 .plt
Comments:
1) clocks are measured in millions (10^6), instructions
two millions (2*10^6). dispatch2 has lower number of instructions
executed to clocks, presumably due to indirect calls
2) actual cost of call may be slightly lower because apparently
even at safety 0 and having fixnum declarations ECL still
uses function call for some fixum operations.
--
Waldek Hebisch
hebisch at math.uni.wroc.pl
More information about the ecl-devel
mailing list