[Mono-list] CIL
Zaphod
j0k3rin@yahoo.co.in
Tue, 3 Sep 2002 00:52:27 +0530
On Mon, Sep 02, 2002 at 03:58:15PM +0000, Freddy BL wrote:
> I don't belive, that compiling IL-Code in memory-space to CVM and compiling
> CVM to native-code, that this is faster then the direct compiling of IL-code
> to native-code (in memory).
Well from what I could grep from pnet docs (and leech from the pnet devel
at college) was that
IL -> CVM is possible as well as JVM -> CVM or Parrot -> CVM ... So in
short CVM acts as a sort of Pointer based bytecode specification which
is faster to interpret than IL ..
Mono is using a JIT , which is fast for repeated method calls ... JIT'ing
is a costly process ... The pnet's hotspot optimisation does something like
optimise only the frequently executed instructions ... For example , the
arithmetic,logical and load/store operations are "unrolled" into x86 code.
But method invocations may not be ... So in effect the overhead of full
JIT'ing is avoided . (an example would be tail calls ...)
> And _if_ this indirection is faster: Why don't mono the same?
A full JIT performs well in a single platform .... 'mono' is faster , but
'mint' is slower than pnet ...
> And if it is _not_ faster (what I think): Why choose p.net this way?
for the "p" --> portability ... using a faster interpreter allows pnet
to become easily portable...than mono which needs to produce the .brg
and trampolines for each platform...
> And where is the advatage of p.net in comparison to mono?
A compiler which does not need itself ? (I'm joking !)... And of course
a C compiler which compiles to IL ...
> I don't see any advantage. (I have never understood, why the p-net project
> exists, because there exists mono)
Well pnet is a GNU project ... and of course it was the first to start.
Also it comes on my Mandrake ISOs..
Personally, I cannot but appreciate one person taking something so far and
for fun !!! .. I am convinced that Rhys Weatherly is an alien ! ... (j/k)
(maybe I should switch to decaf .... and stop seeing X-files)
> To this, what you have cite, it seems, that compiling CVM-bytecode directly
> to native-code is faster then compiling .net-bytecode directly to
> native-code.
Yup... Because (as stated on pnet site) ... CVM is not polymorphic
like IL ... ie IL 'add' can add int & int or float & float ... It takes
a certain number of checks on the stack states to determine which
code the JIT should produce .... Such dynamic flow analysis slows down
JIT'ing of the IL code.
> In this case I ask myself, why p.net don't use the CVM-bytecode _instead_
> the IL-code. Why existing no compiler which save the CVM-bytecode on disc,
> so that this code is that, what can be startet?
Of course, I saw it somewhere on the dotgnu mailing lists ... "CVM uses
pointers and memory on the heap," and so forth and cannot be written down
to the disk as it has no meta-data available to load or resolve.
> If the CVM-Bytecode is realy better then the IL-code, why don't create p.net
> not its own VM, which needs its own Bytecode-files instead of trying to
> start .net- and Java-programs direct (with the JIT-detour over CVM)?
Shh... it's "classified" .... part of their world domination plan ... ;-)
Also, Freddy ... Pnet & Mono has buried the hatchet ... this discussion
might just make some people dig up theirs .. k