Hi, All!

Rafael's guess is correct. Since Java doesn't support structs at all - we are forced to
use classes instead of all ValueTypes.  In case of struct array initialization - our converter
(which converts MSIL => Java bytecode) generates "hidden" helper functions
which initialize each element of array before first usage of such array.

Ilya.



Rafael Teixeira wrote:
I maybe due to the fact that Java, doesn't have value objects other
than the basic crowd (int, long, double, float...), and to be able to
have the value semantics GH has to create lots of
imuttable/cloneable/value-comparable objects...

Just guessing...

On 6/9/05, Ben Maurer <[EMAIL PROTECTED]> wrote:
  
On Thu, 2005-06-09 at 19:05 -0400, Gonzalo Paniagua Javier wrote:
    
On Wed, 2005-06-08 at 14:11 +0300, Ilya Kharmatsky wrote:
      
Please review the patch.

BTW, in HtmlTextWriter.cs we changed internal structs (e.g.
RenderStyle) to be the classes
 and not structs - this in order to resolve heavy performance problem
in our implementation
 of initialization of arrays of structs. May be the better idea is to
change also original mono
 code - since in this case we can avoid additional "splitting" of code
between standard and
 J2EE configuration. I think impact of this won't be too high - from
perspective of memory
 consumption and performance.
        
RenderAttribute, TagInformation and RenderStyle might be ok as classes.
As you say, this is no big deal. Feel free to make those classes if
nothing breaks.
      
What exactly do you guys do when initing an array of structs that is so
slow?

In this case, chances are, performance won't suffer that much. It does
make our GC do more work than it needs to (and it is already pretty
heavy on stuff).

However, there are cases where using arrays of structs will give us a
large benefit in C#. So it would make sense to figure out what is
happening, rather than to shove it under the rug.

-- Ben

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

    


  
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to