A Moment's insight is sometimes worth a Life's experience.
Tim Driven Development | Test until the fear goes away
A Moment's insight is sometimes worth a Life's experience.
Tim Driven Development | Test until the fear goes away
A Moment's insight is sometimes worth a Life's experience.
A Moment's insight is sometimes worth a Life's experience.
Here is the code:That appears to show that you can iterate a 10⁷‑element List in about 0.24μs and there is no significant difference between the two implementations.campbell@campbellsComputer:~/java$ java ListSpeedDemo arraylist
With an ArrayList it took 239054ns
campbell@campbellsComputer:~/java$ java ListSpeedDemo vector
With an Vector it took 243199ns
A Moment's insight is sometimes worth a Life's experience.
Tauri Valor wrote: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.
That is 0.6″ as against about 0.08″.campbell@campbellsComputer:~/java$ java ListSpeedDemo arrayList
With an ArrayList it took 84439761ns and found 1109692 doctors.
campbell@campbellsComputer:~/java$ java ListSpeedDemo vector
With an Vector it took 620384900ns and found 1114150 doctors.
A Moment's insight is sometimes worth a Life's experience.
A Moment's insight is sometimes worth a Life's experience.
Tauri Valor wrote: . . .
A Moment's insight is sometimes worth a Life's experience.
Thank goodness for that.Tauri Valor wrote:Typo only in the pasted code here. . . .
I missed a major point to tell you. I am performing search operation for 200 times using for loop in the test
A Moment's insight is sometimes worth a Life's experience.
A Moment's insight is sometimes worth a Life's experience.
A Moment's insight is sometimes worth a Life's experience.
A Moment's insight is sometimes worth a Life's experience.
Tauri Valor wrote: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.
A Moment's insight is sometimes worth a Life's experience.
Tauri Valor wrote:Im reading the data from csv file holding 100000 records and then adding them to ArrayList, not loading them into DB.
And they might be quicker for the next query because you have all the data ready to investigate.Dave Tolls wrote:. . . [databases] . . . might prove quicker doing this than trying to find a faster Collection than ArrayList. . . .
Why fit in when you were born to stand out? - Seuss. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|