Problems of Data class

Hai Wei

Greenhorn

Posts: 13

posted 14 years ago

Hi all I find some performance problems in suncertify.db.Data class: 1. The methods of Data class use the synchronized keyword to guarantee the integrity of data. 2. The linear find method. problem 1 means everything is executed sequentially no matter how many thread is in service, when the program use single Data object. problem 2 means every time the find method is called it will walk through all the data. And the disk operation is the slowest operation of one computer. And the problem 1 + problem 2 can produce big performance problems. The question is: Can I change the implementation of Data class? Is there anyone who change the implementation and pass the test? (I'm not sure whether change the implementation will result in automatic failure.) Any advice about these problems? Thank you in advance.

Hai Wei

Greenhorn

Posts: 13

posted 14 years ago

I've got the reply from Sun. "Yes, it's ok to modify the implementation."

Yes it is a performance issue. But luckily you don't need to worry about it. You can keep the code as is. I haven't heard of anyone changing it and getting more points because they did. However, you do open the risk of losing points if it isn't done right. Your choice. Mark

The advice is in the requirements, -- the clarity and simplicity first, the performance is only secondary. When it comes to performance, all they ask you is to write a decent implementation of your criteriaFind() method, and you will do just fine. Eugene.