hashmap

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

hashmap比golang内置的map添加速度要快,1000w数据hashmap比内置map快几百毫秒-1秒 删除速度也较快 内存占用由于hashmap实现的原因,在接近2^n但不到2^n时,hashmap占用空间较小,当hashmap扩容时(此时元素刚刚超过2^n,但是容量翻翻),hashmap会比内置map占用内存大。

Index

Constants

View Source
const (
	DEFAULT_INITIAL_CAPACITY = 1 << 4
	MAXIMUM_CAPACITY         = 1 << 30 // 最大容量
	DEFAULT_LOAD_FACTOR      = 0.75    // 阈值比率
)

Variables

This section is empty.

Functions

func New

func New(initialCapacity int, loadFactor float64) *hashMap

func NewMap

func NewMap() *hashMap

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL