This topic has been archived. It cannot be replied.
-
工作学习 / 学科技术 / 看看大家的java最简单的基本功扎实不,虽然linkedList理论上插入复杂度的常数特别小,适合插入删除操作多的,但为什么现实中基本不建议是用LinkedList而清一色使用ArrayList哪怕是高频插入和删除的?
-zhengy4(_);
2022-12-1
(#14993380@0)
+1
-
一个是连续的,一个是hash的,hash查询插入快捷容易
-**🦌;
2022-12-1
(#14993395@0)
-
Java不熟悉,猜想大概是追求数据在内存中尽量靠拢,减少 CPU Cache Miss
-cricketkiller(白牙青);
2022-12-1
(#14993401@0)
+2
-
正解!arraylist可以大幅度减少cache missing,而插入/删除复杂度里的大常数在cache missing面前不值得一提。linkedList内存跳跃非常容易产生cache missing。。。。
-zhengy4(_);
2022-12-1
(#14993406@0)
+2
-
大部分搞Java的都不会关心这个,用得多是因为google 出来的example code都是Arraylist,
-sxffff(lookingforjob);
2022-12-2
(#14995801@0)
+1
-
高频能高到哪儿去?个做Java的就少吹了。人家高频是用C加FPGA
-firetrain(火车头);
2022-12-1
(#14993767@0)
-
C加FPGA是在低速验证阶段。正式应该用硬件加速,加上GPU shader code,至少也要用NEON 汇编
-spitfireto(很有意思);
2022-12-3
(#14997168@0)
+1
-
C/C++加上FPGA是很常见的一种LOW LATENCY解决方案。不需要GPU.
-tuteng(闻风而动);
2022-12-3
(#14997943@0)
-
C/C++ on FPGA?! Do you guys really know what you are talking about?
-hubeir(pct);
2022-12-3
(#14997947@0)
-
你没做过吧? 我做过。C++写驱动,运算在FPGA上。数据吞吐极大时,不用通过主机的CPU.
-tuteng(闻风而动);
2022-12-3
(#14997953@0)
-
VHDL or Verilog了解一下
-hubeir(pct);
2022-12-3
(#14997968@0)
-
哈哈
-tuteng(闻风而动);
2022-12-3
(#14997977@0)
-
如果low latency真的很重要,是不应该在FPGA上面跑C/C++的
-hubeir(pct);
2022-12-3
(#14998045@0)
-
C/C++为什么要在FPGA上跑?FPGA上生成的是线路实现的运算逻辑,跑不了程序。C/C++一般是在芯片上另一块简化的软CPU上运行,起驱动作用,没有操作系统。
-tuteng(闻风而动);
2022-12-3
(#14998052@0)
-
你没做过吧? 我做过。C++写驱动,运算在FPGA上。数据吞吐极大时,不用通过主机的CPU. -tuteng(闻风而动);
-hubeir(pct);
2022-12-3
(#14998063@0)
-
唉,上年纪了就不要老争了。我这不是说得很明白,C++写的是驱动程序,运算是在FPGA上? 你以为C++运算在FPGA上?
-tuteng(闻风而动);
2022-12-3
(#14998067@0)
-
你刚从你儿子实习的公司复制的来的吧,fpga一般要用Verilog或者systemC
-zhengy4(_);
2022-12-7
(#15006122@0)
-
你连算法理论里的高频的意思都没理解就不要忙着回帖了。另外我以前在AMD 做asic的idct的。
-zhengy4(_);
2022-12-7
(#15006119@0)
-
玩C#的,从来没用过linkedList,就是IList<T>到处用,已经觉得快得不得了
-binghongcha76(一只大猫);
2022-12-2
(#14994501@0)
-
你们搞得太复杂,我们外行听不懂。还不如说是Work In Office vs Work From Home 的优缺点😃
-chaojia(心平气和);
2022-12-2
(#14995832@0)
-
LinkedList适合于在遍历过程中进行修改。这种需求很少。一般修改数据往往需要random read/write。这一点LinkedList的效率低。
-iamflying(叶和花);
2022-12-3
(#14996392@0)
-
我就是讨论初衷即使修改多的list,也是arraylist 好就是因为cache的问题。算法理论都是说高频修改需要上linkedlist因为复杂度0(n)中的常数K小,但理论和实际往往脱节,这就是我原题的意思
-zhengy4(_);
2022-12-7
(#15006153@0)
-
要看怎么修改。如果不断地向arraylist头部插入和删除,就不能用ArrayList,而要用ArrayDeque。Collection很多,现实中绝对没有清一色使用ArrayList。有时候会摒弃使用Java自带的,而改用第三方的Collection
-iamflying(叶和花);
2022-12-7
(#15006232@0)
-
这两个东西存储数据本身没有意义,还是要看存储的数据你是要怎么处理法。比如你要写个简单的text编辑器,就可以用linkedlist。你要是想sort,当然选arrayliat
-whoislikethegod(We The People);
2022-12-3
(#14997972@0)
-
Sort也是 arraylist快,毕竟基本cache都可以cache了,插入删除操作只要没有cache missing都比linked快。而且linkedlist有太多overhead,可能linked在特殊的无cache的特殊cpu比如asic的情况下会有比较好的插入删除表现
-zhengy4(_);
2022-12-7
(#15006139@0)
-
这是个算法问题,C/C++/Java都适用
-hubeir(pct);
2022-12-3
(#14998041@0)
+1
-
那是,不过c++现在就像white crow一样了,很少有招聘的,我所有的知识体国留在c++11.基本现在默认语言就是java了。
-zhengy4(_);
2022-12-7
(#15006130@0)
-
给点个赞👍 咱加拿大华人移民,不论杀鱼卖房,还是修车开店,都有深厚的IT背景
-eleclan(eleclan);
2022-12-3
(#14998070@0)
-
我一直以为是需求造成的,难道不是吗?
理由1: ArrayList 查询快 增删慢;linkedList 查询慢 增删快。实际需求中查询远远多于增删。
理由2: java标准的写法是 ArrayList list = new ArrayList(); 但在应用时总是用接口实现: List <T> list = new ArrayList(); 这样的好处是一旦改为LinkedList,只需改动一行即可:List<T> list = new LinkedList(); 也就是说可随时改为LinkedList 如果需求发生变化
-simon68(康益);
2022-12-20
{357}
(#15041642@0)