comp.lang.ada
 help / color / mirror / Atom feed
* Linear Search
@ 2016-09-28 16:41 Jeffrey R. Carter
  2016-09-28 17:23 ` Niklas Holsti
  2016-09-29  4:39 ` Paul Rubin
  0 siblings, 2 replies; 10+ messages in thread
From: Jeffrey R. Carter @ 2016-09-28 16:41 UTC (permalink / raw)


This is not really Ada related, but on an Intel Atom x5-Z8500 computer running
Linux Mint 18, I can find the maximum of 70 million random Unsigned_32s
(generated using the Threefry RNG), using a sequential linear search, in about
200 ms. This is fast enough that it appears instantaneous to a human.

Since the processor has 4 cores, a parallelization of the search using 8 tasks
should be able to search 500 million values in about the same time (if they fit
in memory).

I can't imagine any real application in which I would keep that many values in
memory. Usually they'd be in some sort of DB that would do the search for me. So
now I'm wondering if there's really any need for O(log N)-search-time structures.

-- 
Jeff Carter
"Death awaits you all, with nasty, big, pointy teeth!"
Monty Python & the Holy Grail
20


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-09-29  5:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-28 16:41 Linear Search Jeffrey R. Carter
2016-09-28 17:23 ` Niklas Holsti
2016-09-28 18:24   ` Jeffrey R. Carter
2016-09-28 21:03     ` Niklas Holsti
2016-09-28 22:20       ` Jeffrey R. Carter
2016-09-28 20:21   ` Randy Brukardt
2016-09-28 23:08     ` Jeffrey R. Carter
2016-09-29  5:40       ` Randy Brukardt
2016-09-29  4:39 ` Paul Rubin
2016-09-29  4:47   ` Jeffrey R. Carter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox