Fastest PNG decoder for .NET

前端 未结 4 1403
猫巷女王i
猫巷女王i 2021-02-05 03:32

Our web server needs to process many compositions of large images together before sending the results to web clients. This process is performance critical because the server can

4条回答
  •  梦谈多话
    2021-02-05 04:06

    Have you tried the following 2 things.

    1)
    Multi thread it, there is several ways of doing this but one would be a "all in" method. Basicly fully spawn X amount of threads, for the full proccess.

    2)
    Perhaps consider having XX thread do all the CPU work, and then feed it to the GPU thread.

    Your question is very well formulated for being a new user, but some information about the senario might be usefull? Are we talking about a batch job or service pictures in real time? Do the 10k pictures change?

    Hardware resources
    You should also take into account what hardware resources you have at your dispoal. Normaly the 2 cheapest things are CPU power and diskspace, so if you only have 10k pictures that rarly change, then converting them all into a format that quicker to handle might be the way to go.

    Multi thread trivia
    Another thing to consider when doing multithreading, is that its normaly smart to make the threads in BellowNormal priority.So you dont make the entire system "lag". You have to experiment a bit with the amount of threads to use, if your luck you can get close to 100% gain in speed pr CORE but this depends alot on the hardware and the code your running.

    I normaly use Environment.ProcessorCount to get the current CPU count and work from there :)

提交回复
热议问题