Tauri Valor

Ranch Hand
+ Follow
since Aug 03, 2005
Merit badge: grant badges
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tauri Valor

In a web application which is supposed to be highly secured, spring security has been implemented.
During the test with web debugging proxy tool(fiddler), the password which the user submitted is visible in clear text. Password has been encrypted on the server side, but during its traversal from client to server http request has been intercepted by proxy and password is shown by the proxy tool. Is it acceptable ? Anyways the the application will be 'https' enabled in live.
7 years ago
I have set simple web app using Hibernate4 + Spring 4 + Jboss EAP-6.3.0 .

The following is an issue while launching the application:

The error is misleading as I have already set hibernate.dialect property in xml file as below:

Its too confusing to actually find out the problem.

Can this be looked into please ?

Yes you are right. I'm placing the user selection in String array 'pattern'. For the test I'm assuming all the values in array as selected.
8 years ago
Im reading the data from csv file holding 100000 records and then adding them to ArrayList, not loading them into DB.
8 years ago
Bill this is for testing my scenario to yeild a better result than ArrayList. I have 100000 records of Person to be searched 200 times.
8 years ago
Processor and Speed: Intel(R) Core(TM)2 Duo CPU T7500 @2.20GHz 2.20GHz
I cannot use Stream because of the version issue.

So finally, I think ArrayList is the best option for me.

Thank you all GREATS who have participated in the discussion, special thanks to Campbell. Thanks for your precious time!!

8 years ago

I missed a major point to tell you. I am performing search operation for 200 times using for loop in the test

Just for the sake of test. I'm not doing anything with the return value. Just measuring the time.
8 years ago
Typo only in the pasted code here. But in the original code by which the test was made it is correct.

8 years ago
I missed a major point to tell you. I am performing search operation for 200 times using for loop in the test, I'm not including the time to read from CSV. And that's why the result.
Yes, I must not think of comparing Map with a List. But was curious about the result just experimenting. My goal is to get a better result than the ArrayList.

The following is my test code:

8 years ago
My Processor and Speed: Intel(R) Core(TM)2 Duo CPU T7500 @2.20GHz 2.20GHz
I have 100,000 records which will grow over time.
I reading the data currently from CSV data file, no DB being used for my requirement .
I'm so sorry that I was so abstract, while giving only an outline of what I need (I'm compelled to do so ).
From all your expert comments and code, I believe and can conclude that probably ArrayList will be the best preference.

I also tried, by adding all of my ArrayList in a LinkedHashSet and made a search, it yeilded me a result which is closest so far to ArrayList:

Adding to the earlier results in Nanoseconds.

8 years ago
I do not really have a complex search strategy, but simply searching for an exact phrase/s depending on the user selection. I placed the selection in a String array as below:

and then search as follows:

Neither did I use a profiler, I was just manually switching different collections and noting down the efficiency.

8 years ago
@Campbell Ritchie Thanks for the Edit.
Stephan, Thanks for the Trie solution.
I have a search requirement to simply have a look up of the people with prefixes in the pattern from a List of People Objects. It doesn't always compares my query String to the beginning of result. I need to search for a Pattern of Strings in a String array eg:

8 years ago
Thanks Tim.

Im looking for a data structure which yeilds me be better result than the ArrayList. I have a requirement which demands a more efficient result than that of ArrayList.
8 years ago
I have performed the test using various Collections - Set implementations, Map implementations and List implementations. Following are the results in nanoseconds:

Sorry, I couldnt format the result more than that

As seen from the above, ArrayList is far better than all other collections for the scenario mentioned. (For Key,Value requirement of Map, I used unique identifier EmpID as key and Emp object as value. )
8 years ago
Can there be any efficient Collection/DataStructure more efficient than ArrayList for the following scenario?

I have a List of Employee objects in an ArrayList. I have to perform a search in this List basing on criteria for eg. search for String Patterns "MR", "MRS","MS"...etc.
8 years ago