Coder Social home page Coder Social logo

jstd_hashmap's Introduction

jstd_hashmap

| 中文版 | English Version |

Chinese / 中文版

TODO: //

编译和使用方法

1. 克隆 Git 仓库

git clone https://gitee.com/shines77/jstd_hashmap.git
# 或者
git clone https://github.com/shines77/jstd_hashmap.git

2. 配置与编译

切换到本仓库的根目录,执行:

cmake .
make

3. 其他脚本

清理 cmake 的缓存和编译结果(便于重新配置和编译):

./cmake-clean.sh

4. 运行 benchmark

# 跟 Google sprasehash 开源库类似的测试

# 默认迭代次数为 10000000(无参数时)
./bin/time_hash_map

# 迭代次数 8000000
./bin/time_hash_map 8000000


# 低、中、高、超高 - 基数测试
./bin/cardinal_bench


# 小数据集测试
./bin/benchmark

# 中数据集测试
./bin/benchmark ./data/Maven.keys.txt

jstd_hashmap's People

Contributors

shines77 avatar guo-cpp avatar

Stargazers

hyb avatar

Watchers

James Cloos avatar  avatar

Forkers

kevinying16

jstd_hashmap's Issues

关于 Swiss Table (absl::flat_hash_map)

最近测试我改进的swiss table- emilib2/3. 我的实现查询性能比官方慢20%,插入则快20%,一直分析对比查找哪里查询慢(我在乎查询性能),一个区别在于我使用线性探测,而swiss table使用二次探测,还有你之前说的swiss做了随机内存地址优化,这些难道是主要原因?

-------------------------------- function benchmark -----------------------------------------------
erase_50
  85        emilib3                100.0%
  95        emilib2                89.9%
  97        absl_flat              87.5%

erase_reinsert
  62        absl_flat              100.0%
  88        emilib3                70.1%
 100        emilib2                62.2%

find_erase_50
  79        absl_flat              100.0%
  94        emilib3                84.1%
  99        emilib2                80.3%

find_hit_0
  85        absl_flat              100.0%
  92        emilib2                92.8%
  98        emilib3                87.2%

find_hit_100
  83        absl_flat              100.0%
  94        emilib2                88.5%
  97        emilib3                85.7%

find_hit_50
  85        absl_flat              100.0%
  93        emilib2                91.3%
  97        emilib3                87.2%

find_hit_50_erase
  91        absl_flat              100.0%
  94        emilib3                97.2%
  98        emilib2                92.9%

hash_iter
  44        emilib2                100.0%
  44        emilib3                99.0%
 100        absl_flat              44.3%

insert_erase
  71        emilib3                100.0%
  86        absl_flat              82.9%
  97        emilib2                73.0%

insert_find_erase
  76        emilib3                100.0%
  93        emilib2                81.6%
  96        absl_flat              79.0%

insert_hit
  93        emilib3                100.0%
  96        emilib2                96.4%
  97        absl_flat              96.0%

insert_l1_cache
  33        emilib2                100.0%
  35        emilib3                94.5%
 100        absl_flat              33.5%

insert_l3_cache
  86        emilib3                100.0%
  89        emilib2                97.2%
  97        absl_flat              89.0%

insert_no_reserve
  94        emilib3                100.0%
  95        absl_flat              99.7%
  96        emilib2                97.9%

multi_small_ife
  84        emilib3                100.0%
  93        emilib2                90.8%
  95        absl_flat              88.5%

======== hash  top1   top2  top3 =======================
    absl_flat  2.0   4.0   22
      emilib2  0.0  22.0    6
      emilib3 26.0   2.0    0
======== hash    score  weigh ==========================
    absl_flat    85     92.4%
      emilib2    88     95.0%
      emilib3    93     100.0%
--------------------------------------------------------------------

Originally posted by @ktprime in #1 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.