English 中文(简体)
pin_ptr exercise relative to soil (VC) heapbject
原标题:pin_ptr performance relative to native (VC) heap objects

在C#至CLI/C++总结中,我选择:

  • St或e native pointer in a managed class (native object is created using native "new")

  • St或e native object as a data blob in a managed class field, and use pin_ptr to pin it bef或e each native use.

Has anyone done any comparative analysis on the relative perf或mance costs of the two paths?

感谢!

问题回答

基本内容是防止在管理下坡子上被理事会搬出,因为当其发言被转给当地职能时,那些对主席有了解的人可以由理事会拉。 它不会影响对本土的 he或 st的记忆。

把本土物体作为有管理的阶层的生物圈子,是C++管理的混合类型。 找回一个点子,在所收集的垃圾上留下一个没有掩饰的痕迹,并可能 later倒 app,这个问题太难解。 这个问题非常常见(人们并不期望主席能够被GC夺走),微软决定完全可以区分混合类型,因此,人们必须明确指明目标记忆在哪里。

可能没有什么差别。 GC拨款实际上略高于本地new。 如果目标在GC进行收集时被搁置,则附带条件只是一个绩效问题。 如果被管理的物体的大小足以进入LOH,那么pin就没有。

但是,我只字不提。

我要说的是,利用全球健康与福利,把目标放在职能电话之间。 这比设立<代码>pin_ptr的成本更高,而且对GC的影响更大。 对于需要永久居住的数据,使用本土分配器。





相关问题
What to look for in performance analyzer in VS 2008

What to look for in performance analyzer in VS 2008 I am using VS Team system and got the performance wizard and reports going. What benchmarks/process do I use? There is a lot of stuff in the ...

SQL Table Size And Query Performance

We have a number of items coming in from a web service; each item containing an unknown number of properties. We are storing them in a database with the following Schema. Items - ItemID - ...

How to speed up Visual Studio 2008? Add more resources?

I m using Visual Studio 2008 (with the latest service pack) I also have ReSharper 4.5 installed. ReSharper Code analysis/ scan is turned off. OS: Windows 7 Enterprise Edition It takes me a long time ...

Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

热门标签