sorted_set_nif:由基于Rust的NIF支持的Elixir SortedSet

时间:2021-04-01 10:47:58
【文件属性】:
文件名称:sorted_set_nif:由基于Rust的NIF支持的Elixir SortedSet
文件大小:40KB
文件格式:ZIP
更新时间:2021-04-01 10:47:58
Elixir 不和谐排序集 SortedSet是一种快速高效的数据结构,可提供某些保证和功能。 核心数据结构和算法是使用以Rust编程语言在“本机实现的功能”中实现的。 安装 将SortedSet添加到您的依赖项中,然后使用mix do deps.get, deps.compile进行安装 def deps do [ { :sorted_set_nif , " ~> 1.0.0 " } ] end 实施细节 在内部,将存储在SortedSet中的Elixir术语转换为Rust等效项,并存储在Vector的Vector中。 该结构类似于跳过列表,几乎SortedSet上的每个操作都会在存储桶中执行线性扫描,以找到拥有该术语的存储桶,然后在存储桶中进行二进制搜索以完成操作。 为什么不只是术语向量? 人们探索了这种方法,但是当Vector需要超出其能力时,将条款复制到新的更大Vector上
【文件预览】:
sorted_set_nif-master
----mix.lock(2KB)
----.gitignore(710B)
----mix.exs(2KB)
----native()
--------sorted_set_nif()
----.travis.yml(527B)
----.formatter.exs(130B)
----LICENSE(1KB)
----bench()
--------construction.exs(1KB)
--------add.exs(2KB)
----README.md(5KB)
----config()
--------config.exs(15B)
----lib()
--------sorted_set.ex(10KB)
--------sorted_set()
----test()
--------from_enumerable_test.exs(2KB)
--------sorting_test.exs(596B)
--------concurrency_test.exs(16KB)
--------index_remove_test.exs(2KB)
--------add_test.exs(10KB)
--------support()
--------test_helper.exs(15B)
--------to_list_test.exs(747B)
--------index_add_test.exs(10KB)
--------new_test.exs(265B)
--------from_proper_enumerable_test.exs(1KB)
--------slice_test.exs(3KB)
--------at_test.exs(1KB)
--------size_test.exs(992B)
--------remove_test.exs(2KB)
--------find_index_test.exs(838B)

网友评论