Tuesday, January 04, 2005

NET I/O

I am not sure, if is that a term called "NET I/O". But I heard this from my boss. For those who wnat to know, according to my boss this term meant that:
Avoid I/O activities if possible. I/O here meant read/write data back to harddisk.
Why do we need it?
Of course, you and me may know that it is for improving application perfromance.

How to avoid I/O?
Very easy. Compare the original and new field value (REPLACE, UPDATE). If both values are difference then only we replace/update it.

How much does it improve the performance?
According to my testing, NET I/O is at least 20% faster.

When should we implement NET I/O into our application?
Batch Processing. As usual, Batch Processing may take up to few minutes, hours or days to accomplish its task such as calculating payroll, account posting or etc. Assume we have 1,000,000 records to be processed, and we can save 10 miliseconds per update, then we would be able to save 16.6667 minutes.

When should we NOT to implement NET I/O into our application?
Data entry and process that only involve few records update. Unless your users complaint that your application is very very very slow.

Drawback
It will complicate our coding. Even though we only required to write code to compare (IF ... ELSE ... ENDIF) before update, however, if there are more than ten fields to be updated, then we may need to have ten IF to compare each field value, or, one very long IF condition to compare all fields in advance. It is not a easy maintain code.

Additional Info
A tip published in FoxProAdvisor (can't remember which issue), assign a value to a property is FOUR times slower than read value from a property. I think it would be the almost the same for read/write data to table.

0 Comments:

Post a Comment

<< Home