java中的fastutil

FastUtil是一个扩展Java集合框架的高性能库,提供了针对特定类型的集合实现,如Map、Set、List和Queue等,具备小巧内存占用及快速访问与插入特性。它还支持64位数组、集合以及高效的文件I/O操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


======================================================
注:本文源代码点此下载
======================================================

java中提供很多集合类,比如arraylist,hashmap等等。但你有没有发现其中的这些集合类都是泛型的,有的时候你会发现用泛型会比较慢。慢在哪呢?慢就慢在基本类型的装包和拆包。当你处理大数量的时候,这个慢有的时候就不能接受了。

那这怎么解决呢?推荐大家使用fastutil,一个意大利实验室出品,主要用在其的webgraph上。

下面是其官方网站对其的介绍:

fastutil extends the java™ collections framework by providing type-specific maps, sets, lists and queues with a small memory footprint and fast access and insertion; provides also big (64-bit) arrays, sets and lists, and fast, practical i/o classes for binary and text files. it is free software distributed under the apache license 2.0. it requires java 6 or newer. the classes implement their standard counterpart interface (e.g., map for maps) and can be plugged into existing code. moreover, they provide additional features (such as bidirectional iterators) that are not available in the standard classes. besides objects and primitive types, fastutil classes provide support for references, that is, objects that are compared using the equality operator rather than the equals() method. the sources are generated using a c preprocessor, starting from a set of driver files. you can peek at thejavadoc-generated documentation. in particular, the overview explains the design choices used in fastutil.

我目前在很多自己写的实验代码中在用,发现挺好用的,比java自带的要好用很多,尤其是对于基本类型。

本文基于署名 2.5 中国大陆许可协议发布,欢迎转载,演绎或用于商业目的,但是必须保留本文的署名小橋流水(包含链接)。如您有任何疑问或者授权方面的协商,请给我发邮件

标签: java, fastutil, 技术

绿色通道:好文要顶关注我收藏该文与我联系


======================================================
在最后,我邀请大家参加新浪APP,就是新浪免费送大家的一个空间,支持PHP+MySql,免费二级域名,免费域名绑定 这个是我邀请的地址,您通过这个链接注册即为我的好友,并获赠云豆500个,价值5元哦!短网址是http://t.cn/SXOiLh我创建的小站每天访客已经达到2000+了,每天挂广告赚50+元哦,呵呵,饭钱不愁了,\(^o^)/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值