Re: Re: Flat Short of MEMORY_BLOCK

"Franck Arnaud" <[email protected]>
Newsgroups gmane.comp.lang.eiffel.gobo.general
Message-ID <[email protected]>
Brian Heilig:

Thanks for those tests!

> The times seem to indicate that Franck and Berend's tests were 
> invalid because `test' was optimized out.

Not with gcc: I set the repeat rate to take a few seconds to
execute on my machine, and it varied proportionally when I changed 
the number of repeats. Assembly checks confirm it looks like it's 
doing what is expected, so gcc is less clever than MS C here.

> memcpy (&buffer[i], &a_byte, how);
[...]
> array 1.490002
> memcpy 42.758552

Similar results with gcc.

> Inspection of the disassembly indicates that memcpy was not inlined. 
> My original fear was that eiffel code would also suffer the same 
> fate, that is, it would not be inlined. As you can see if memcpy is 
> not optimized out the results can be dramatic.

OK, this is the sort of case where it sounds genuinely 
useful :-).

> I suppose the best  answer would be to compare the benchmarks 
> of two MANAGED_POINTERs that are implemented using array 
> access and memcpy.

Sounds like a good idea. If array is faster, you may then 
look at using an auxiliary array (SPECIAL/NATIVE_ARRAY) 
inside the memory block implementation, maybe in addition 
to the MANAGED_POINTER, which may get the same result 
(compiling to a C array access) without backend 
dependencies.



To Post a message, send it to:   [email protected]
To Unsubscribe, send a blank message to: [email protected] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/gobo-eiffel/

<*> To unsubscribe from this group, send an email to:
     [email protected]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.