Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6383209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:37:14+00:00 2026-05-25T02:37:14+00:00

HI i have a 32bit application being ported to 64bit somehow method calls of

  • 0

HI i have a 32bit application being ported to 64bit
somehow method calls of 64bit is a lot slower than 32bit.

code example

    class huge_class
{
 class subclass0{}
 class subclass1{}
 class subclass2{}
 class subclass3{}
 class subclass4{}
 class subclass5{}
 class subclass6{}
 class subclass7{}
 //so on... say 300

 private object[] GetClassObj(Stopwatch x)
 {
       Console.WriteLine(x.ElapsedMilliseconds.ToString()); //<- the latency can be observed here, the time it takes to execute this line takes a big amount of time
       object[] retObj = new object[300];
       retObj[0] = new subclass0();
       retObj[1] = new subclass1();
       retObj[2] = new subclass2();
       retObj[3] = new subclass3();
       retObj[4] = new subclass4();
       retObj[5] = new subclass5();
       retObj[6] = new subclass6();
            //so on... to 299
 }
}

    Class CallingClass{
  static void Main(string[] args)
    {


        Console.WriteLine("Ready");
        Console.ReadKey();
        huge_class bigClass = new huge_class();
        Console.WriteLine("Init Done");
        Console.ReadKey();
        Stopwatch tmr = Stopwatch.StartNew();
        object[] WholeLottaObj = bigClass.GetClassObj(tmr);
        Console.WriteLine(tmr.ElapsedMilliseconds.ToString());
        Console.WriteLine("Done");
        Console.ReadKey();
}

for some odd reason on 32bit the GetClassObj is entered faster than on its 64bit version
what am i doing wrong

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:37:14+00:00Added an answer on May 25, 2026 at 2:37 am

    This may be due to cache coherency. Don’t forget that each reference will be twice as large on a 64-bit machine as it is on a 32-bit machine. That means:

    • Each of your instance objects is going to be bigger, so they’ll be spread out further in memory (there’s more per-object overhead in x64 anyway, and any reference fields will be twice the size)
    • The array itself will be about twice as big

    Now it could easily be that in the 32-bit CLR you were just within one of the fastest caches on your CPU – whereas on the 64-bit CLR you’ve gone outside it so it’s having to swap memory in and out of that cache, either to another cache or to main memory.

    That’s why x86 is the default for executable projects in VS2010 (and possibly 2008; not sure). This blog post goes into a lot more detail.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following scenario: - 64bit Windows Server 2008. - 32bit .NET application
I have an application that we're trying to migrate to 64bit from 32bit. It's
We have an legacy application that accesses the registry. Because it is a 32bit
I have a 32bit Delphi application which needs to use Redemption to talk with
I have a file that has a 32bit version and a 64bit version. If
Is there a way from a 32bit application running on a 64bit system to
I've got a piece of code that calls the DeleteFile method in the Microsoft.VisualBasic.FileIO.FileSystem
I have 32bit third party dll. I am using same dll in c# application.
We currently have an web application running on IIS6 on a 32bit machine. This
I have created an application in .NET. When I compile a 64bit version and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.