gxhash 0.1.1__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of gxhash might be problematic. Click here for more details.

Files changed (41) hide show
  1. {gxhash-0.1.1 → gxhash-0.1.2}/PKG-INFO +2 -2
  2. {gxhash-0.1.1 → gxhash-0.1.2}/py-gxhash/README.md +1 -1
  3. gxhash-0.1.2/py-gxhash/gentoo_root.img +0 -0
  4. {gxhash-0.1.1 → gxhash-0.1.2}/py-gxhash/main.py +38 -39
  5. {gxhash-0.1.1 → gxhash-0.1.2}/py-gxhash/src/lib.rs +0 -1
  6. {gxhash-0.1.1 → gxhash-0.1.2}/pyproject.toml +1 -1
  7. {gxhash-0.1.1 → gxhash-0.1.2}/.cargo/config.toml +0 -0
  8. {gxhash-0.1.1 → gxhash-0.1.2}/.gitattributes +0 -0
  9. {gxhash-0.1.1 → gxhash-0.1.2}/.github/workflows/bench.yml +0 -0
  10. {gxhash-0.1.1 → gxhash-0.1.2}/.github/workflows/build_test.yml +0 -0
  11. {gxhash-0.1.1 → gxhash-0.1.2}/.github/workflows/cross_compile.yml +0 -0
  12. {gxhash-0.1.1 → gxhash-0.1.2}/.github/workflows/rust_version.yml +0 -0
  13. {gxhash-0.1.1 → gxhash-0.1.2}/.gitignore +0 -0
  14. {gxhash-0.1.1 → gxhash-0.1.2}/CITATION.cff +0 -0
  15. {gxhash-0.1.1 → gxhash-0.1.2}/Cargo.lock +0 -0
  16. {gxhash-0.1.1 → gxhash-0.1.2}/Cargo.toml +0 -0
  17. {gxhash-0.1.1 → gxhash-0.1.2}/LICENSE +0 -0
  18. {gxhash-0.1.1 → gxhash-0.1.2}/README.md +0 -0
  19. {gxhash-0.1.1 → gxhash-0.1.2}/benches/hashset.rs +0 -0
  20. {gxhash-0.1.1 → gxhash-0.1.2}/benches/ilp.rs +0 -0
  21. {gxhash-0.1.1 → gxhash-0.1.2}/benches/quality/main.rs +0 -0
  22. {gxhash-0.1.1 → gxhash-0.1.2}/benches/throughput/aarch64.svg +0 -0
  23. {gxhash-0.1.1 → gxhash-0.1.2}/benches/throughput/main.rs +0 -0
  24. {gxhash-0.1.1 → gxhash-0.1.2}/benches/throughput/result_processor.rs +0 -0
  25. {gxhash-0.1.1 → gxhash-0.1.2}/benches/throughput/x86_64-avx2.svg +0 -0
  26. {gxhash-0.1.1 → gxhash-0.1.2}/benches/throughput/x86_64-hybrid.svg +0 -0
  27. {gxhash-0.1.1 → gxhash-0.1.2}/benches/throughput/x86_64.svg +0 -0
  28. {gxhash-0.1.1 → gxhash-0.1.2}/benches/throughput_criterion.rs +0 -0
  29. {gxhash-0.1.1 → gxhash-0.1.2}/build.rs +0 -0
  30. {gxhash-0.1.1 → gxhash-0.1.2}/examples/hello_world.rs +0 -0
  31. {gxhash-0.1.1 → gxhash-0.1.2}/py-gxhash/Cargo.lock +0 -0
  32. {gxhash-0.1.1 → gxhash-0.1.2}/py-gxhash/Cargo.toml +0 -0
  33. {gxhash-0.1.1 → gxhash-0.1.2}/py-gxhash/gxhash.pyi +0 -0
  34. {gxhash-0.1.1 → gxhash-0.1.2}/py-gxhash/uv.lock +0 -0
  35. {gxhash-0.1.1 → gxhash-0.1.2}/rustfmt.toml +0 -0
  36. {gxhash-0.1.1 → gxhash-0.1.2}/src/gxhash/mod.rs +0 -0
  37. {gxhash-0.1.1 → gxhash-0.1.2}/src/gxhash/platform/arm.rs +0 -0
  38. {gxhash-0.1.1 → gxhash-0.1.2}/src/gxhash/platform/mod.rs +0 -0
  39. {gxhash-0.1.1 → gxhash-0.1.2}/src/gxhash/platform/x86.rs +0 -0
  40. {gxhash-0.1.1 → gxhash-0.1.2}/src/hasher.rs +0 -0
  41. {gxhash-0.1.1 → gxhash-0.1.2}/src/lib.rs +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gxhash
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -16,7 +16,7 @@ Python bindings for [GxHash](https://github.com/ogxd/gxhash), a blazingly fast a
16
16
  - **Blazingly Fast**: Minimal-overhead binding to leverage the full speed of GxHash.
17
17
  - **Zero Python**: Pure Rust backend with zero additional Python runtime overhead.
18
18
  - **Fine-Grained Control**: Build true multi-threaded or async hashing pipelines with GIL-free APIs.
19
- - **Faster File Hashing**: Hash files directly using memory-mapped I/O via Rust — 3x faster than Python's sequential I/O.
19
+ - **Faster File Hashing**: Hash files using memory-mapped I/O via Rust — 3x faster than Python's sequential I/O.
20
20
  - **Async-Ready**: Tokio-powered async hashing for fast and efficient concurrency.
21
21
  - **Fully Typesafe**: Predictable, clean API with complete type safety.
22
22
 
@@ -7,7 +7,7 @@ Python bindings for [GxHash](https://github.com/ogxd/gxhash), a blazingly fast a
7
7
  - **Blazingly Fast**: Minimal-overhead binding to leverage the full speed of GxHash.
8
8
  - **Zero Python**: Pure Rust backend with zero additional Python runtime overhead.
9
9
  - **Fine-Grained Control**: Build true multi-threaded or async hashing pipelines with GIL-free APIs.
10
- - **Faster File Hashing**: Hash files directly using memory-mapped I/O via Rust — 3x faster than Python's sequential I/O.
10
+ - **Faster File Hashing**: Hash files using memory-mapped I/O via Rust — 3x faster than Python's sequential I/O.
11
11
  - **Async-Ready**: Tokio-powered async hashing for fast and efficient concurrency.
12
12
  - **Fully Typesafe**: Predictable, clean API with complete type safety.
13
13
 
Binary file
@@ -89,17 +89,16 @@ collected=7
89
89
 
90
90
  async def main():
91
91
  try:
92
- input_bytes = bytes([42] * 10000000)
92
+ with Path("gentoo_root.img").open("rb") as img:
93
+ input_bytes = img.read()
94
+ # input_bytes = bytes([42] * 10000000)
95
+
93
96
  seed = 1234
94
- file = TemporaryFile()
95
- event_loop = get_running_loop()
96
- file.write(input_bytes)
97
- file.seek(0)
98
- gxhash128 = GxHash128(seed=seed)
97
+ gxhash64 = GxHash64(seed=seed)
98
+ thread_pool = ThreadPoolExecutor()
99
99
 
100
100
  start = perf_counter_ns()
101
- thread_pool = ThreadPoolExecutor()
102
- futures = [gxhash128.hash(input_bytes) for _ in range(1)]
101
+ futures = [gxhash64.hash(input_bytes) for _ in range(1)]
103
102
  print(f"{(perf_counter_ns() - start) / 1_000_000} ms")
104
103
 
105
104
  tempfiles = [TemporaryFile() for _ in range(1)]
@@ -108,7 +107,7 @@ async def main():
108
107
  tfile.seek(0)
109
108
 
110
109
  start = perf_counter_ns()
111
- hash128_async = [gxhash128.hash_file(tfile) for tfile in tempfiles]
110
+ hash128_async = [await gxhash64.hash_async(input_bytes) for tfile in tempfiles]
112
111
  print(f"{(perf_counter_ns() - start) / 1_000_000} ms")
113
112
 
114
113
  # await asyncio.gather(gxhash(), collect())
@@ -121,33 +120,33 @@ if __name__ == "__main__":
121
120
  run(main())
122
121
 
123
122
 
124
- async def main():
125
- seed = 1234
126
- input_bytes = bytes([42] * 1000)
127
- file = TemporaryFile()
128
- file.write(input_bytes)
129
- file.seek(0)
130
- gxhash32 = GxHash32(seed=seed)
131
- gxhash64 = GxHash64(seed=seed)
132
- gxhash128 = GxHash128(seed=seed)
133
-
134
- hash32 = gxhash32.hash(input_bytes)
135
- hash32_nogil = gxhash32.hash_nogil(input_bytes)
136
- hash32_file = gxhash32.hash_file(file)
137
- file.seek(0)
138
- hash32_file_async = await gxhash32.hash_file_async(file)
139
- assert hash32 == hash32_nogil == hash32_file == hash32_file_async
140
-
141
- hash64 = gxhash64.hash(input_bytes)
142
- hash64_nogil = gxhash64.hash_nogil(input_bytes)
143
- hash64_file = gxhash64.hash_file(file)
144
- file.seek(0)
145
- hash64_file_async = await gxhash64.hash_file_async(file)
146
- assert hash64 == hash64_nogil == hash64_file == hash64_file_async
147
-
148
- hash128 = gxhash128.hash(input_bytes)
149
- hash128_nogil = gxhash128.hash_nogil(input_bytes)
150
- hash128_file = gxhash128.hash_file(file)
151
- file.seek(0)
152
- hash128_file_async = await gxhash128.hash_file_async(file)
153
- assert hash128 == hash128_nogil == hash128_file == hash128_file_async
123
+ # async def main():
124
+ # seed = 1234
125
+ # input_bytes = bytes([42] * 1000)
126
+ # file = TemporaryFile()
127
+ # file.write(input_bytes)
128
+ # file.seek(0)
129
+ # gxhash32 = GxHash32(seed=seed)
130
+ # gxhash64 = GxHash64(seed=seed)
131
+ # gxhash128 = GxHash128(seed=seed)
132
+
133
+ # hash32 = gxhash32.hash(input_bytes)
134
+ # hash32_nogil = gxhash32.hash_nogil(input_bytes)
135
+ # hash32_file = gxhash32.hash_file(file)
136
+ # file.seek(0)
137
+ # hash32_file_async = await gxhash32.hash_file_async(file)
138
+ # assert hash32 == hash32_nogil == hash32_file == hash32_file_async
139
+
140
+ # hash64 = gxhash64.hash(input_bytes)
141
+ # hash64_nogil = gxhash64.hash_nogil(input_bytes)
142
+ # hash64_file = gxhash64.hash_file(file)
143
+ # file.seek(0)
144
+ # hash64_file_async = await gxhash64.hash_file_async(file)
145
+ # assert hash64 == hash64_nogil == hash64_file == hash64_file_async
146
+
147
+ # hash128 = gxhash128.hash(input_bytes)
148
+ # hash128_nogil = gxhash128.hash_nogil(input_bytes)
149
+ # hash128_file = gxhash128.hash_file(file)
150
+ # file.seek(0)
151
+ # hash128_file_async = await gxhash128.hash_file_async(file)
152
+ # assert hash128 == hash128_nogil == hash128_file == hash128_file_async
@@ -17,7 +17,6 @@ fn gxhash_nogil<T: Send>(py: Python, hasher: fn(&[u8], i64) -> T, bytes: &[u8],
17
17
  fn gxhash_file<T>(hasher: fn(&[u8], i64) -> T, file_descriptor: i32, seed: i64) -> PyResult<T> {
18
18
  let file = unsafe { std::fs::File::from_raw_fd(libc::dup(file_descriptor)) };
19
19
  let mmap = unsafe { memmap2::Mmap::map(&file)? };
20
- drop(file);
21
20
  Ok(hasher(&mmap, seed))
22
21
  }
23
22
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "gxhash"
3
- version = "0.1.1"
3
+ version = "0.1.2"
4
4
  requires-python = ">=3.7"
5
5
  dynamic = ["version"]
6
6
  classifiers = [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes