TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

GlueList – Fast New Java List Implementation

44 点作者 ertucetin将近 9 年前

14 条评论

zinxq将近 9 年前
Iteration will be slower than Arraylist.<p>Just like LinkedList (which is even worse), there will be cache misses on jumps to new nodes.<p>Random access lookup will be (very slightly) slower as you determine which node to look inside.<p>This is hardly a new datastructure. Just one that&#x27;s been thought of before and not standardized due to lack of compelling performance differentiation.
评论 #12277135 未加载
评论 #12276924 未加载
erikb将近 9 年前
I&#x27;m scepctical if I just read &quot;fastest X&quot;. Fastest at what? Here it seems it is way faster at adding elements. But what about moving elements, sorting, searching, deleting? In most optimizations you get faster in one operation and slower in some others.<p>And if you decide to optimize one operation over the others some usecases for that would be great as well. The most expensive things I needed to do with lists were sorting. Having a list type that improves this operation over the others would be most reasonable for me.<p>Last but not least I think the List is such an old and often used data structure, it is very unlikely one can develop something a lot faster.
leeter将近 9 年前
Seems like a java implementation of std::deque <a href="http:&#x2F;&#x2F;en.cppreference.com&#x2F;w&#x2F;cpp&#x2F;container&#x2F;deque" rel="nofollow">http:&#x2F;&#x2F;en.cppreference.com&#x2F;w&#x2F;cpp&#x2F;container&#x2F;deque</a>
评论 #12275351 未加载
评论 #12277295 未加载
cristaloleg将近 9 年前
Is this a unrolled linked list implementation? <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Unrolled_linked_list" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Unrolled_linked_list</a>
评论 #12274771 未加载
评论 #12274712 未加载
topbanana将近 9 年前
This is fine and dandy, until your list becomes heavily fragmented. Suddenly traversing your list becomes a series of expensive cache misses.<p>So it&#x27;s not &#x27;faster&#x27;, it depends very much on the use case - like any data structure.
评论 #12274970 未加载
leecarraher将近 9 年前
some thoughts:<p>remove and add worst case complexity is O(mn) ! that is terrible, linked list should be able to do inserts and removes in O(1).<p>the test of appending is faster. but is it? I would offer that it&#x27;s likely java doing some more datatype and bounds checking in their implementations, which is inline with the marginal speedup and relatively linear growth complexity. furthermore there are resize effects that will happen periodically as big malloc+move events.<p>worse case complexity seems incorrect for worse case search and access. assuming bins, you&#x27;d have to traverse the bin as well, so access should be O(m+n) .<p>but what about a remove test, or an actual search test? this looks somewhat like a b-tree.
评论 #12276259 未加载
评论 #12276915 未加载
ccleve将近 9 年前
What&#x27;s old is new again:<p><a href="http:&#x2F;&#x2F;javolution.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;javolution.org&#x2F;</a><p>This library has been around forever, and extends the same concept to other collection types.
kingnuscodus将近 9 年前
It seems this may have been done already: have you looked at Clojure data structures implementations? Most, e.g vector, use a 32-branching factor with constant access&#x2F;upate time. Clojure data types are all accessible from Java. Check it out: <a href="http:&#x2F;&#x2F;clojure.org&#x2F;reference&#x2F;data_structures#Vectors" rel="nofollow">http:&#x2F;&#x2F;clojure.org&#x2F;reference&#x2F;data_structures#Vectors</a>
grashalm将近 9 年前
Bad title. Datastructures always come with trade offs. In this case Insertion Speed and memory efficiency vs iteration and random access Speed.
chvid将近 9 年前
Why is everything in the root namespace? Have you used this library for any real-life project?<p>Try something like sort for a benchmark.
ape4将近 9 年前
In addition to what everyone else has said, ArrayList may get faster with a Java update.
blaisio将近 9 年前
This makes me wish I could downvote things on HN. This is not new, nor is there any significant evidence that it&#x27;s &quot;fastest&quot; (a term that doesn&#x27;t really mean much without context anyway).
revertts将近 9 年前
The benchmarks do not use caliper or jmh. This is _very_ important - microbenchmarks on the JVM rarely do what you think they do without extra work.
jkot将近 9 年前
Using sun.misc.Unsafe to access array elements would make it much faster. Also ArrayList with preset size is faster for inserting elements.
评论 #12276543 未加载