Posted By: SecretSoftware | Oct 19th, 2007 @ 2:40 PM
page 1 of 1
Comments: 4 | Views: 1252
SecretSoftware
SecretSoftware
Code to live, but Live to code.
Suppose you have soemthing like this

string a = this.SomeMethodA (this.SomeMethodB (this.SomeMethodC (this.SomeMethodD (this.SomeMethodE(this.SomeMethodF("someStringTo Process"))))));


Its supposed to be evaluated backwards , and each one is evaluated once.

However in VS 2008 Beta 2, you get this

First :

Eval Method: F();

Eval Method : F() then E(); ( Note: F() got evaluated again!!).

Eval Method F() then E() then D(); (Note: F() and E() got evaluated again wasting valuable CPU Cycles and ram).

Etc..


This is the same perfomrance bug that plauged the 2005 build of VS in terms of project building, where the building would rebuild projects that is already built again as it goes up the building order. The same similar bug exist here too?


This causes valuable CPU Cycles to be wasted and its really annoying. Its slows application performance. Why this recursive pattern? why not just evaluate each sub method in the execution plan once? why evaluate it over and over again as you jump up one function in the execution plan?

Thanks.
CannotResolveSymbol
CannotResolveSymbol
{insert caption here}
Can't reproduce.  Tested it with:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1 {
    class Program {
        static void Main(string[] args) {
            Console.WriteLine(methodA(methodB(methodC("Test"))));
        }
        static String methodA(String a) {
            return a + " A";
        }
        static String methodB(String a) {
            return a + " B";
        }
        static String methodC(String a) {
            return a + " C";
        }
    }
}

and it only runs C, B, then A.  You can confirm this with the disassembly:


.method private hidebysig static void  Main(string[] args) cil managed
{
  .entrypoint
  // Code size       26 (0x1a)
  .maxstack  8
  IL_0000:  ldstr      "Test"
  IL_0005:  call       string ConsoleApplication1.Program::methodC(string)
  IL_000a:  call       string ConsoleApplication1.Program::methodB(string)
  IL_000f:  call       string ConsoleApplication1.Program::methodA(string)
  IL_0014:  call       void [mscorlib]System.Console::WriteLine(string)
  IL_0019:  ret
} // end of method Program::Main

Can you share some code to reporoduce this. I am failed to reporoduce it.
If it is happening then it is the most disturbing and ugly thing to have in VS2008.

Regards, 

evildictaitor
evildictaitor
if( !succeed( try() ) ) { while(true) try(); }
This thread is to do with Visual Studio 2008 _BETA2_. This issue does not affect Visual Studio 2008.
page 1 of 1
Comments: 4 | Views: 1252
Microsoft Communities