Re: [討論] Use Jagged Arrays

看板C_Sharp (C#)作者 (替機殼洗個熱水澡)時間20年前 (2005/12/10 00:41), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
http://www.codeproject.com/dotnet/arrays.asp 解答在網頁中有講 ※ 引述《virdust2003 (替機殼洗個熱水澡)》之銘言: : Performance Tips and Tricks in .NET Applications : 文章Title : 不知道為什麼 Jagged Arrays 會比 Rectangular arrays 好? : Use Jagged Arrays—Version 1 : The v1 JIT optimizes jagged arrays (simply 'arrays-of-arrays') more : efficiently than rectangular arrays, and the difference is quite noticeable. : Here is a table demonstrating the performance gain resulting from using : jagged arrays in place of rectangular ones in both C# and Visual Basic : (higher numbers are better): : C# Visual Basic 7 : Assignment (jagged) Assignment (rectangular) : 14.16 8.37 : 12.24 8.62 : Neural Net (jagged) Neural net (rectangular) : 4.48 3.00 : 4.58 3.13 : Numeric Sort (jagged) Numeric Sort (rectangular) : 4.88 2.05 : 5.07 2.06 : The assignment benchmark is a simple assignment algorithm, adapted from the : step-by-step guide found in Quantitative Decision Making for Business : (Gordon, Pressman, and Cohn; Prentice-Hall; out of print). The neural net : test runs a series of patterns over a small neural network, and the numeric : sort is self-explanatory. Taken together, these benchmarks represent a good : indication of real-world performance. : As you can see, using jagged arrays can result in fairly dramatic performance : increases. The optimizations made to jagged arrays will be added to future : versions of the JIT, but for v1 you can save yourself a lot of time by using : jagged arrays. -- ----------------------------------------------------------------------------- 功課重,Project多的好幫手--專案王 http://steven.twbbs.org/ProjectKing 增加右鍵的威力RightMenuKing--右鍵王 http://steven.twbbs.org/RightMenuKing/ 備份重要檔案的好幫BackupKing--備份王 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.113.123.165
文章代碼(AID): #13cREyFv (C_Sharp)
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
文章代碼(AID): #13cREyFv (C_Sharp)