Solved

Pagefaults: How much do they impact performance nowadays?

Posted on 2011-02-14
3
422 Views
Last Modified: 2013-12-17
How important are pagefaults nowadays?

It used to be pagefaults were the dominating factor determining performance (and completely ignored in all those analyses of algorithms). But now computers typically have more than 2GB of ROM—the entire program and program data can fit in ROM.

Does this mean I needn't worry about where data is placed in memory like I used to?

For example, here's a test I did back in the mid 1980's:
Below are two examples of a FORTRAN nested Do loop which sets every element of an array A  to the value X. Both programs achieve exactly the same result; the only difference between the two is the order in which the array elements are referenced.

The example on the left loops with the first index I changing most often, while the example on the right loops with the last index K changing most often.
    DIMENSION A(100, 100, 100)    DIMENSION A(100, 100, 100)
    X = 1.0                       X = 1.0
    DO 10, K=1, 100               DO 10, I=1, 100
    DO 10, J=1, 100               DO 10, J=1, 100
    DO 10, I=1, 100               DO 10, K=1, 100
10  A(I,J,K) = X              10  A(I,J,K) = X
    END                           END

Open in new window

While the two examples appear to be nearly identical, a test run of the two programs reveals a startling difference between the two  —  the example on the left took 45 seconds to run using 30 seconds of CPU time, while the example on the right took 1 1/2 hours to run using 17 minutes of CPU time! [in the 1980's]

Ever since then I've been careful about data placement in memory and what order it's accessed.

Now with C# I don't have as much control over where in memory data is placed, and I'm wondering if I still need to be concerned about that.
0
Comment
Question by:deleyd
3 Comments
 
LVL 74

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 166 total points
ID: 34892825
And don't forget about the garbage collector  = )


I believed the canned response is to say, "let the compiler figure it out." While there are subtleties to be attentive to such as the scenario you outline above, I would say for the most part, you are going to let the compiler do the work for you in a language like C# or Java. In languages such as C, you may be more inclined to monitor memory usage, but today, that is mostly a task for the embedded systems guys.
0
 
LVL 4

Assisted Solution

by:zylver
zylver earned 167 total points
ID: 34893237
kaufmed touch an important point; "the compiler". today the compilers optimizes this thing. and you only need to worry about the bussines logic. this is the goal of microsoft. be more productive forgetting the little problems
0
 
LVL 5

Accepted Solution

by:
dcesari earned 167 total points
ID: 34894872
Nowadays probably the equivalent of pagefault is cachehit or cachemiss - are you accessing sets of data that fit in the processor cache or not? - but the techniques to achieve cache hits are similar to those to avoid pagefaults.

I agree that now compilers do much of the work for you and in the fortran program you show, the loops would be automatically reordered even at the smallest level of optimization, however the compiler has a small-scale view of your code, and limited power to reorganize the large-scale design decisions that you took, if you design a GUI application this is of no importance, but if you manage big arrays of data, especially on multithreaded applications / multicore architectures, then how you organize and access the data in memory can still do the difference even with microsoft compilers.

0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Hangfire / asp.net sample 3 30
Pass through dll 2 38
.Net Web Site Password specs 2 21
ConsoleSql 1 21
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now