TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: When are large data structures used in practice?

8 pointsby rtheunissenabout 5 years ago
Can anyone share some practical examples where it is a requirement to maintain 1M+ elements in a data structure when streams and iterators are not a viable alternative?<p>Using a vector as an example, where O(n) operations are actually very fast in practice when n &lt; X, when might X be big enough in practice to warrant the use of other specialized structures like skip lists and radix-balanced trees?

5 comments

shooabout 5 years ago
How about cases where the data structures need to support &quot;interesting&quot; query operations. E.g. data structures to support spatial queries: &quot;find me all the neighbouring elements within a radius r of element x&quot;. Not super-specialised, but probably need something like a quadtree or a hash table or other indices to help partition the search space. There can easily be 1M+ elements if each element is an address in state &#x2F; national address database, or a component of some utility network, or a location of an app user. There are use cases where you&#x27;d want to be able to execute these kinds of queries with low latency, so jamming everything into ram in an appropriate data structure could be a good fit.
posnetabout 5 years ago
Any sort of DNA processing. There is a lot of research into concise data structures for a very specific set of operations for DNA processing since our ability to generate DNA data is accelerating much master than processing or memory speed.
评论 #22774646 未加载
wshabout 5 years ago
Here’s one example:<p>In the IPv4 Internet, there are about 830,000 prefixes (network addresses) announced, and the number is growing [1]. Routers at ISPs and sophisticated customers maintain full (“default-free”) routing tables with at least one entry for each prefix.<p>These tables are used for packet forwarding decisions, so lookups have to be fast. Traditionally, a radix tree is used, but some routers use other data structures or specialized hardware.<p>[1] <a href="https:&#x2F;&#x2F;www.cidr-report.org&#x2F;as2.0&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.cidr-report.org&#x2F;as2.0&#x2F;</a>
评论 #22774659 未加载
ecesenaabout 5 years ago
Not sure if this fits the example you have in mind: <a href="https:&#x2F;&#x2F;medium.com&#x2F;pinterest-engineering&#x2F;an-update-on-pixie-pinterests-recommendation-system-6f273f737e1b" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;pinterest-engineering&#x2F;an-update-on-pixie-...</a><p>&gt; The ultimate goal is to fit the entire Pinterest graph in memory. Obviously we can’t fit the entire 100 billion edges in RAM, but once we prune down to 20 billion edges, we end up with a graph that’s 150GB.
arduinomancerabout 5 years ago
Do you mean specifically 1M elements in memory?<p>Because something like a relational database could have 1M elements in a B-tree but the whole data structure doesn&#x27;t have to be in memory at the same time.<p>Or operating system page tables as another example.
评论 #22765856 未加载