memory-optimization

Garbage collection and correct usage of pointers in Go

こ雲淡風輕ζ 提交于 2020-01-12 09:40:32
问题 I come from a Python/Ruby/JavaScript background. I understand how pointers work, however, I'm not completely sure how to leverage them in the following situation. Let's pretend we have a fictitious web API that searches some image database and returns a JSON describing what's displayed in each image that was found: [ { "url": "https://c8.staticflickr.com/4/3707/11603200203_87810ddb43_o.jpg", "description": "Ocean islands", "tags": [ {"name":"ocean", "rank":1}, {"name":"water", "rank":2}, {

Garbage collection and correct usage of pointers in Go

你离开我真会死。 提交于 2020-01-12 09:38:14
问题 I come from a Python/Ruby/JavaScript background. I understand how pointers work, however, I'm not completely sure how to leverage them in the following situation. Let's pretend we have a fictitious web API that searches some image database and returns a JSON describing what's displayed in each image that was found: [ { "url": "https://c8.staticflickr.com/4/3707/11603200203_87810ddb43_o.jpg", "description": "Ocean islands", "tags": [ {"name":"ocean", "rank":1}, {"name":"water", "rank":2}, {

shared memory optimization confusion

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 08:46:32
问题 I have written an application in cuda , which uses 1kb of shared memory in each block. Since there is only 16kb of shared memory in each SM, so only 16 blocks can be accommodated overall ( am i understanding it correctly ?), though at a time only 8 can be scheduled, but now if some block is busy in doing memory operation, so other block will be scheduled on gpu, but all the shared memory is used by other 16 blocks which already been scheduled there, so will cuda will not scheduled more blocks

Automated field re-ordering in C structs to avoid padding

坚强是说给别人听的谎言 提交于 2019-12-18 04:02:47
问题 I've spent a few minutes manually re-ordering fields in a struct in order to reduce padding effects[1], which feels like a few minutes too much. My gut feeling says that my time could probably be better spent writing up a Perl script or whatnot to do this kind of optimization for me. My question is whether this too is redundant; is there already some tool that I'm not aware of, or some compiler feature that I should be able to turn on[2] to pack structs? The issue is even more complicated by

shared memory optimization confusion

守給你的承諾、 提交于 2019-12-05 16:06:41
I have written an application in cuda , which uses 1kb of shared memory in each block. Since there is only 16kb of shared memory in each SM, so only 16 blocks can be accommodated overall ( am i understanding it correctly ?), though at a time only 8 can be scheduled, but now if some block is busy in doing memory operation, so other block will be scheduled on gpu, but all the shared memory is used by other 16 blocks which already been scheduled there, so will cuda will not scheduled more blocks on the same sm , unless previous allocated blocks are completely finished ? or it will move some block

Automated field re-ordering in C structs to avoid padding

拥有回忆 提交于 2019-11-29 03:52:49
I've spent a few minutes manually re-ordering fields in a struct in order to reduce padding effects[1], which feels like a few minutes too much. My gut feeling says that my time could probably be better spent writing up a Perl script or whatnot to do this kind of optimization for me. My question is whether this too is redundant; is there already some tool that I'm not aware of, or some compiler feature that I should be able to turn on[2] to pack structs? The issue is even more complicated by the fact that this needs to be consistently optimized across a few different architectures, so whatever

Reducing memory usage of .NET applications?

余生颓废 提交于 2019-11-26 12:47:49
What are some tips to reduce the memory usage of .NET applications? Consider the following simple C# program. class Program { static void Main(string[] args) { Console.ReadLine(); } } Compiled in release mode for x64 and running outside Visual Studio, the task manager reports the following: Working Set: 9364k Private Working Set: 2500k Commit Size: 17480k It's a little better if it's compiled just for x86 : Working Set: 5888k Private Working Set: 1280k Commit Size: 7012k I then tried the following program, which does the same but tries to trim process size after runtime initialization: class

Reducing memory usage of .NET applications?

我的未来我决定 提交于 2019-11-26 03:05:35
问题 What are some tips to reduce the memory usage of .NET applications? Consider the following simple C# program. class Program { static void Main(string[] args) { Console.ReadLine(); } } Compiled in release mode for x64 and running outside Visual Studio, the task manager reports the following: Working Set: 9364k Private Working Set: 2500k Commit Size: 17480k It\'s a little better if it\'s compiled just for x86 : Working Set: 5888k Private Working Set: 1280k Commit Size: 7012k I then tried the