Files
dify-plugin-sdks/python/test.py
T
Yeuoly 83cd0ee184 feat: implement 11 new Lark trigger events and convert JSON outputs to proper data structures
- 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>
2025-10-14 16:16:50 +08:00

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)