Jump to content

Using ArrayPool in a plugin


null54

Recommended Posts

Is there a recommend method for utilizing the ArrayPool<T> class in a plugin?

 

My AvifFileType plugin creates a lot of short-lived byte arrays that would benefit from being pooled.
Currently I am using a private ArrayPool that is based on the .NET Core 2.2 source code.

 

I see that Paint.NET has an ArrayPoolBuffer class in PaintDotNet.Base.dll, is that available/supported for use by plugins?

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

I should add an ArrayPoolService via the AppModel interfaces. Then you can easily use that, and I can eventually sandbox and do cleanup if so that if a plugin requests a bunch of buffers that aren't used elsewhere.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...