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 9010091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:22:03+00:00 2026-06-16T02:22:03+00:00

I have a 64 bit system. Im declaring my variables as 64 bit variables

  • 0

I have a 64 bit system. I”m declaring my variables as 64 bit variables expecting my code to run faster. When I do functions such as ‘String.IndexOf(“J”, X)’, it fails because X is a Long but it is looking for a 32 bit value as the start index.

Is there any way to pass a 64 bit variable without converting it down to a 32 bit?

  • 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-06-16T02:22:04+00:00Added an answer on June 16, 2026 at 2:22 am

    You got the wrong idea about 64-bit code. The arguments to the String.IndexOf() method do not change, the second argument is still an Integer. The only type in .NET that changes size is IntPtr.

    This is all very much by design. A 64-bit processor does not execute code faster when you let it manipulate 64-bit integral values. Quite the contrary, it makes it run slower. Processor speed is throttled in large part by the size of the caches. The CPU caches are important because they help avoid the processor having to read or write data from RAM. Which is very slow compared to the speed of the processor. A worst-case processor stall from not having data in the L1, L2 or L3 caches can be 200 cycles.

    The cache size is fixed. Using 64-bit variables makes the cache half as effective.

    You also make your code slower by using Long and Option Strict Off. That requires the compiler to emit a conversion to cast the Long to an Integer. It is not visible in your code but it certainly is performed, you can see it when you look at the IL with ildasm.exe or a decompiler like ILSpy or Reflector.

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

Sidebar

Related Questions

I have this bit of code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data;
Is it possible to have 32 bit operating system running on 64 bit processor
I have a 64 bit windows operating system and I use VS2008 to write
i have bit of code that causes an underflow: var t1, t2, delta: DWORD:
I have a .NET 2.0 application that won't run on a 64-bit OS (the
I am working on a 64 bit windows system. And I have a 64
I have a 32-bit process that can run either in 32-bit or 64-bit Windows.
I have a 32 bit operating system and i am under visual studion 2010.
I have a bit more complex system... I have users model - hasMany Ads
Windows update on my Windows 7 64 bit system says I have an optional

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.