diff --git a/README.md b/README.md index e755bca..2e1e843 100644 --- a/README.md +++ b/README.md @@ -182,8 +182,10 @@ SQLite 开发文件 ```bash cd src/core - maturin develop + maturin develop --release ``` + 将会在 `src/core/target/release` 目录下生成 `core.dll` 或 `core.so` 文件。 + 将该文件复制到 `queue_sqlite/core` 目录下(dll文件需改名为pyd后缀)。 4. 运行测试: diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..c230614 Binary files /dev/null and b/requirements.txt differ diff --git a/tests/test_stress.py b/tests/test_stress.py index 9d062dc..a4bc901 100644 --- a/tests/test_stress.py +++ b/tests/test_stress.py @@ -30,6 +30,18 @@ class TestStress: # print(f"callback: {message_item.expire_time}") # print(f"callback: {message_item.tags}") + @classmethod + def test_example(cls): + message_item = MessageItem(content={"num": 1}, destination="example") + start_time = time.perf_counter() + example(message_item) + print(f"测试函数:斐波那契数列") + print(f"总耗时: {time.perf_counter() - start_time:.4f}秒") + start_time = time.perf_counter() + for i in range(10000): + example(message_item) + print(f"总耗时: {time.perf_counter() - start_time:.4f}秒") + @classmethod def test_stress(cls): TASK_NUM = 10000