Skip to main content
added 49 characters in body
Source Link
SLaks
  • 891.3k
  • 182
  • 1.9k
  • 2k

No, thereit won't be any measurable benefitfaster.

This is premature micro-optimization at its worst.

In additionfact, in order to do thisit will be orders of magnitude slower, since you'll need to pin the array using(using the fixed keyword, which is orders of magnitude slower than your existing codefixed keyword) in order to get a pointer to it.

No, there won't be any measurable benefit.

This is premature micro-optimization at its worst.

In addition, in order to do this, you'll need to pin the array using the fixed keyword, which is orders of magnitude slower than your existing code.

No, it won't be any faster.

This is premature micro-optimization at its worst.

In fact, it will be orders of magnitude slower, since you'll need to pin the array (using the fixed keyword) in order to get a pointer to it.

added 6 characters in body; deleted 230 characters in body; added 154 characters in body
Source Link
SLaks
  • 891.3k
  • 182
  • 1.9k
  • 2k

No, there won't be any measurable benefit.

This is premature micro-optimization at its worst.

In addition, you can't evenin order to do it:this, you'll need to pin the array using the fixed keyword, which is orders of magnitude slower than your existing code.

  • Those are properties, not fields
  • Even had they been fields, a field is a managed reference, not a pointer.
    You cannot use it the way you use a pointer, even in unsafe code.

No, there won't be any measurable benefit.

This is premature micro-optimization at its worst.

In addition, you can't even do it:

  • Those are properties, not fields
  • Even had they been fields, a field is a managed reference, not a pointer.
    You cannot use it the way you use a pointer, even in unsafe code.

No, there won't be any measurable benefit.

This is premature micro-optimization at its worst.

In addition, in order to do this, you'll need to pin the array using the fixed keyword, which is orders of magnitude slower than your existing code.

Source Link
SLaks
  • 891.3k
  • 182
  • 1.9k
  • 2k

No, there won't be any measurable benefit.

This is premature micro-optimization at its worst.

In addition, you can't even do it:

  • Those are properties, not fields
  • Even had they been fields, a field is a managed reference, not a pointer.
    You cannot use it the way you use a pointer, even in unsafe code.