POV-Ray : Newsgroups : povray.off-topic : Microsoft may have done something right... Server Time
10 Oct 2024 21:15:55 EDT (-0400)
  Microsoft may have done something right... (Message 11 to 20 of 44)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Chambers
Subject: Re: Microsoft may have done something right...
Date: 22 Mar 2008 15:22:56
Message: <47e56aa0$1@news.povray.org>
Warp wrote:
>   I have no idea about the principles used in C#, but if it's anything like
> Java, the biggest problem is not so much speed as memory usage. In Java
> I don't think there's any way around the problem that you cannot create
> a data container where each element takes as much memory as the total size
> of the members of the object, nothing more. The smaller the object is, the
> worse the memory usage overhead relative to this size.

Wasn't it John Carmack who said that Java is a great way of doing things 
at 1/10th the speed they should be done at? :)

Anyway, one of the first things I noticed in looking over C# is the 
difference in structs and classes.  Basically, a Class is the same as a 
C++ struct / class, with the indirection et al, allocated on the heap. 
A struct, on the other hand, has no member functions, and is a simple 
collection of the base data types all allocated on the stack.  Very 
sparse memory usage, and very fast, either as individual instances or in 
collections.

-- 
...Ben Chambers
www.pacificwebguy.com


Post a reply to this message

From: Chambers
Subject: Re: Microsoft may have done something right...
Date: 22 Mar 2008 15:25:41
Message: <47e56b45$1@news.povray.org>
Warp wrote:
> Chambers <ben### [at] pacificwebguycom> wrote:
>> 2) Resource manage is *incredibly* easy.  In the "Solution Explorer", 
>> simply bring up the context menu and choose "Add Existing" or "Add New", 
>> give it a name (and select the file if it aleady exists), and it's 
>> imported into the correct directory.
> 
>   Does it have any support for creating a (possibly encrypted) package
> from all the resources so that you don't have to distribute a bare version
> of your resources directory structure, but instead you can simply distribute
> this single package file with your program?

It does have support for packaging your projects, but I don't believe it 
has encryption.  It's compiled into a bytecode, so it's very easy to 
decompile into the original sources.  If you encrypted it, then the same 
key which allows it to execute would allow it to be decompiled.

Of course, you could use an obfuscator, and there are commercial 
packages available that integrate nicely with VS to do this 
automagically for you when you build your project.

-- 
...Ben Chambers
www.pacificwebguy.com


Post a reply to this message

From: Chambers
Subject: Re: Microsoft may have done something right...
Date: 22 Mar 2008 17:29:18
Message: <47e5883e$1@news.povray.org>
Chambers wrote:
> C++ struct / class, with the indirection et al, allocated on the heap. A 
> struct, on the other hand, has no member functions,

Woops, this is wrong.  Structs *can* have member functions.

Also, structs are passed by value whereas classes are passed by reference.

-- 
...Ben Chambers
www.pacificwebguy.com


Post a reply to this message

From: Warp
Subject: Re: Microsoft may have done something right...
Date: 23 Mar 2008 05:10:56
Message: <47e62cb0@news.povray.org>
Chambers <ben### [at] pacificwebguycom> wrote:
> >   Does it have any support for creating a (possibly encrypted) package
> > from all the resources so that you don't have to distribute a bare version
> > of your resources directory structure, but instead you can simply distribute
> > this single package file with your program?

> It does have support for packaging your projects, but I don't believe it 
> has encryption.  It's compiled into a bytecode, so it's very easy to 
> decompile into the original sources.

  Hmm, that's not really what I asked...

-- 
                                                          - Warp


Post a reply to this message

From: Chambers
Subject: Re: Microsoft may have done something right...
Date: 23 Mar 2008 12:59:55
Message: <47e69a9b@news.povray.org>
Warp wrote:
> Chambers <ben### [at] pacificwebguycom> wrote:
>>>   Does it have any support for creating a (possibly encrypted) package
>>> from all the resources so that you don't have to distribute a bare version
>>> of your resources directory structure, but instead you can simply distribute
>>> this single package file with your program?
> 
>> It does have support for packaging your projects, but I don't believe it 
>> has encryption.  It's compiled into a bytecode, so it's very easy to 
>> decompile into the original sources.
> 
>   Hmm, that's not really what I asked...
> 

Sorry, you're right.  I was thinking of encrypting the sources, you were 
thinking of encrypting the data.

Anyway, as I said, it does support packaging your project.  And, to 
clarify, that includes the resources.

-- 
...Ben Chambers
www.pacificwebguy.com


Post a reply to this message

From: Warp
Subject: Re: Microsoft may have done something right...
Date: 23 Mar 2008 14:17:36
Message: <47e6acd0@news.povray.org>
Chambers <ben### [at] pacificwebguycom> wrote:
> Anyway, as I said, it does support packaging your project.  And, to 
> clarify, that includes the resources.

  To avoid any misunderstanding: By "packaging" I don't mean "create an
installer file which you can distribute and which will install the program
in the user's computer".

  What I mean is that if it supports creating one single file which has
the data inside it, and then at runtime it reads the data directly from
that file instead of unpackaging it to the disk first (thus restoring
the original directory structure and files inside it).

  In other words, can you do so that your program consists of two files:
An executable file and a data file, and the program runs with just those
two files and doesn't create any additional files?

  Moreover, can some light encryption be applied to this data file (to
make unpackaging it slightly harder)?

-- 
                                                          - Warp


Post a reply to this message

From: Chambers
Subject: Re: Microsoft may have done something right...
Date: 23 Mar 2008 15:14:44
Message: <47e6ba34$1@news.povray.org>
Warp wrote:
> Chambers <ben### [at] pacificwebguycom> wrote:
>> Anyway, as I said, it does support packaging your project.  And, to 
>> clarify, that includes the resources.
> 
>   To avoid any misunderstanding:

To clarify: I understand :)  That is indeed what I am trying to say that 
it does.  At least, as far as I understand it.

Hmm... I'll go try it right now to make sure it works...

-- 
...Ben Chambers
www.pacificwebguy.com


Post a reply to this message

From: Chambers
Subject: Re: Microsoft may have done something right...
Date: 23 Mar 2008 21:42:12
Message: <47e71504@news.povray.org>
Chambers wrote:
> Warp wrote:
>> Chambers <ben### [at] pacificwebguycom> wrote:
>>> Anyway, as I said, it does support packaging your project.  And, to 
>>> clarify, that includes the resources.
>>
>>   To avoid any misunderstanding:
> 
> To clarify: I understand :)  That is indeed what I am trying to say that 
> it does.  At least, as far as I understand it.
> 
> Hmm... I'll go try it right now to make sure it works...
> 

Slight problem: The install file created repeated crashes.  I'll have to 
investigate this further, but I'm done playing with it for today.

-- 
...Ben Chambers
www.pacificwebguy.com


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Microsoft may have done something right...
Date: 24 Mar 2008 17:46:46
Message: <47e82f56@news.povray.org>

> Darren New <dne### [at] sanrrcom> wrote:
>> nemesis wrote:
>>> *Anything* compiles extremely quickly compared to C++.  Just don't perform the
>>> same.
>> With JIT compilers and such, I'm not sure how you can be so sure. :-)
> 
> Look for the top:
>
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all&calc=Calculate&xfullcpu=1&xmem=0&xloc=0&binarytre
>
es=1&chameneosredux=1&fannkuch=1&fasta=1&knucleotide=1&mandelbrot=1&meteor=0&nbody=1&nsieve=1&nsievebits=1&partialsums=
>
1&pidigits=1&recursive=1&regexdna=1&revcomp=1&spectralnorm=1&hello=0&sumcol=1&threadring=1
> with memory performance taken into consideration as well, it only gets worse:
>
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all&calc=Calculate&xfullcpu=1&xmem=1&xloc=0&binarytre
>
es=1&chameneosredux=1&fannkuch=1&fasta=1&knucleotide=1&mandelbrot=1&meteor=0&nbody=1&nsieve=1&nsievebits=1&partialsums=
>
1&pidigits=1&recursive=1&regexdna=1&revcomp=1&spectralnorm=1&hello=0&sumcol=1&threadring=1

www.tinyurl.com for next time...


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Microsoft may have done something right...
Date: 24 Mar 2008 17:47:56
Message: <47e82f9c$1@news.povray.org>
Warp escribió:
>   I have no idea about the principles used in C#, but if it's anything like
> Java, the biggest problem is not so much speed as memory usage. In Java
> I don't think there's any way around the problem that you cannot create
> a data container where each element takes as much memory as the total size
> of the members of the object, nothing more. The smaller the object is, the
> worse the memory usage overhead relative to this size.

Agreed. I hate how I can't make arrays of objects in Java. Only arrays 
of references to objects.


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.