Files
wehub-resource-sync c3749daf48
Tests / test-linux (3.13) (push) Failing after 0s
Tests / test-linux (3.11) (push) Failing after 1s
Tests / lint (push) Failing after 0s
Tests / test-linux (3.9) (push) Failing after 1s
Docker / build (push) Failing after 1s
Docker / build-gpu (push) Failing after 2s
Tests / test-windows (push) Has been cancelled
Tests / test-macos (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:03:03 +08:00

15 lines
603 B
Python

import pytest
import timeit
import re
from mempalace.dialect import Dialect
def test_detect_entities_benchmark():
dialect = Dialect()
text = "Alice went to the market and met Bob who is a nice guy. They both discussed about Dr. Chen and how he solved the big issue. Another sentence with Name and Name2 and SomeName"
# Run the function multiple times to measure the performance
number = 10000
time = timeit.timeit(lambda: dialect._detect_entities_in_text(text), number=number)
print(f"\nDialect._detect_entities_in_text benchmark: {time:.4f} seconds for {number} iterations")