<div class="gmail_quote">On Sun, Jan 24, 2010 at 11:07 AM, Matthew Mondor <span dir="ltr"><<a href="mailto:mm_lists@pulsar-zone.net">mm_lists@pulsar-zone.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
CVS ECL (v10+) seems to indirect many function calls to another<br>
function, function_dispatch(), which doesn't seem to be the case in v9;<br></blockquote><div> </div><div>That is weird. There has been no change in optimization settings going from v9 to v10. The change must lay somewhere before. A test case would be nice.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Although larger size may or may not always be slower, a function I<br>
compared, port_wait(), for instance yields 132 asm lines on 9.8.3 yet<br>
193 asm lines on 10.1.1.</blockquote><div><br></div><div>Sure! Just for the record, the proxy you are mentioning is this one</div><div> cl_objectfn ecl_function_dispatch(cl_env_ptr env, cl_object x) </div></div><div>This function takes a lisp object and returns a directly callable C function pointer. This was a great optimization compared to the previous code that would take all the arguments, the function object and perform a huge dispatch that took a lot of time.</div>
<div><br></div><div>ecl_function_dispatch() is therefore used when we want to call a function and do not have or do not want its C function pointer. This happens for low optimization settings, generic functions, closures, interpreted functions and in general functions that have been defined in a separate file.</div>
<div><br></div><div>Without ecl_function_dispatch() the C address of a function is hard-coded in the caller and thus the callee can not be redefined. It can thus be avoided only when debug optimization settings are low and the function is defined in the same file -- or it is a function that is know not to be redefinable, as those in the COMMON-LISP package.</div>
<div><br></div><div>I would thus be very much interested in knowing under which circumstances you have experienced the change, with perhaps a minimal example and the version of ECL (9.8.3?)</div><div><br></div><div>Juanjo</div>
<br>-- <br>Instituto de Física Fundamental, CSIC<br>c/ Serrano, 113b, Madrid 28006 (Spain) <br><a href="http://juanjose.garciaripoll.googlepages.com">http://juanjose.garciaripoll.googlepages.com</a><br>