mirror of
https://github.com/langgenius/dify-plugin-sdks.git
synced 2026-07-22 02:15:22 -04:00
83cd0ee184
- Add IM/Chat events: message_receive_v1, message_reaction_deleted_v1, chat_member_user_withdrawn_v1, chat_member_bot_added_v1, chat_member_bot_deleted_v1 - Add Drive events: file_read_v1, file_title_updated_v1 - Convert all JSON string outputs to proper arrays/objects across all events - Update YAML schemas to use proper data types (array, object, number) instead of strings - Fix data structure handling for department_ids, user lists, and complex nested objects - Register all new events in provider with appropriate handlers 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
27 lines
564 B
Python
27 lines
564 B
Python
import json
|
|
from io import BytesIO
|
|
|
|
|
|
def test_stdio_benchmark_bytes_concat(benchmark):
|
|
data = json.dumps({"test": "test" * 1000}) + "\n"
|
|
data = data.encode("utf-8")
|
|
|
|
def run_test():
|
|
buffer = b""
|
|
for _ in range(1000):
|
|
buffer += data
|
|
|
|
benchmark(run_test)
|
|
|
|
|
|
def test_stdio_benchmark_bytesio(benchmark):
|
|
data = json.dumps({"test": "test" * 1000}) + "\n"
|
|
data = data.encode("utf-8")
|
|
|
|
def run_test():
|
|
buffer = BytesIO()
|
|
for _ in range(1000):
|
|
buffer.write(data)
|
|
|
|
benchmark(run_test)
|