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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:08:04+00:00 2026-06-09T01:08:04+00:00

I saw this article recently while exploring various ways to work with images at

  • 0

I saw this article recently while exploring various ways to work with images at a pixel-level.

http://www.codeproject.com/Articles/16403/Fast-Pointerless-Image-Processing-in-NET

And the author mentions that

What of the performance cost of using a managed array instead of pointers? Wouldn’t using a managed array be slower than using pointers? It might surprise you, but based on my tests, the answer is no. In my tests, have found that the array method is at least 10% faster than the pointer method.

My first attempt at working with images at a pixel level was using the GetPixel/SetPixel methods, which was incredibly slow. Then I was directed to this link and it was considerably faster.

I haven’t tried the method described in the article but can anyone support it? Or perhaps it is only faster under certain conditions?

  • 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-09T01:08:06+00:00Added an answer on June 9, 2026 at 1:08 am

    That depends quite a bit on how you are accessing the arrays.

    If you are using the length of the array in a loop, the compiler recognises this and knows that it doesn’t have to check the bounds of the index, as the loop itself makes it impossible for the index to be out of bounds. This way of accessing arrays will be close in performance to using pointers.

    If you are accessing the array with an arbitrary index, the compiler has to add the code that checks the bounds of the index, which will add a few instructions to every access. This way of accessing arrays will be slower than using pointers.

    It also depends on how efficient the code is that uses pointers. In the end a pointer is always used to access the array data even if you are using an index to access the array, so it’s always possible to write pointer code that is at least as efficient as the code accessing the array by index.

    Also, it depends on how much processing you are doing. Using marshalling to move the data from and to an image means that you move all the data twice already. If you are doing little processing, that can never be as fast as accessing the data in place.


    Note: The method used to marshal the data in the article only works if the Stride value is positive. If the image is stored upside down in memory (common for Bitmap files), then the Stride value is negative, and the calculated data size will be negative.

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

Sidebar

Related Questions

I came across this article about detecting VMWare or Virtual PC http://www.codeproject.com/KB/system/VmDetect.aspx and I
I could have sworn I saw an article on this recently, but I can't
Hi I recently saw this article on how to store data into objects: $profile
I saw this article on msdn with the example http://msdn.microsoft.com/en-us/library/xfhwa508.aspx So i decided to
I'm looking at the Plugin Authoring article at http://docs.jquery.com/Plugins/Authoring and saw this example in
i saw this In MySQL, joins work for INSERT, UPDATE, and DELETE statements. It's
I saw this article pop-up in my MSDN RSS feed, and after reading through
This is not homework. I saw this article praising Linq library and how great
I just saw this code #pragma warning disable 659, 660, 661 MSDN article is
Recently I saw a Reddit article on using SAT for solving a puzzle [1].

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.