compare string

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
compare length
function test() {
	const str1 = `111UserDSL:
{"config":{"client_channel_configs":[{"client_channel":"test__card","platform_config":{"android":{"fallback_toast":{"content":"自定义:出现了奇怪的问题"},"min_version":"7.3.0","support":true},"ios":{"fallback_toast":{"content":"自定义:出现了奇怪的问题"},"min_version":"7.3.0","support":true},"ipad":{"fallback_toast":{"content":"自定义:出现了奇怪的问题"},"min_version":"7.3.0","support":true},"pc":{"fallback_toast":{"content":"自定义:出现了奇怪的问题"},"min_version":"7.3.0","support":true}}}]},"elements":[{"actions":[{"behaviors":[{"android_url":"https://developer.android.com/","default_url":"https://www.baidu.com","ios_url":"https://www.baidu.com","pc_url":"https://www.windows.com","type":"open_url"},{"client_channel":"test__card","type":"client_message","value":"button-001"},{"type":"callback","value":{"elements":[{"content":"This is a blank card content.","tag":"markdown"},{"fields":[{"is_short":true,"text":{"content":"**🗳工单来源:**\n报事报修","tag":"lark_md"}},{"is_short":true,"text":{"content":"**📝工单类型:**\n客服工单","tag":"lark_md"}}],"tag":"div"}]}}],"confirm":{"text":{"content":"content","tag":"plain_text"},"title":{"content":"title","tag":"plain_text"}},"multi_url":{"android_url":"","ios_url":"","pc_url":"","url":"飞书开放平台"},"tag":"button","text":{"content":"主按钮","tag":"plain_text"},"type":"primary"}],"tag":"action"}]}`
	const str2 = `UserDSL:
{"config":{"client_channel_configs":[{"client_channel":"test__card","platform_config":{"android":{"fallback_toast":{"content":"自定义:出现了奇怪的问题"},"min_version":"7.3.0","support":true},"ios":{"fallback_toast":{"content":"自定义:出现了奇怪的问题"},"min_version":"7.3.0","support":true},"ipad":{"fallback_toast":{"content":"自定义:出现了奇怪的问题"},"min_version":"7.3.0","support":true},"pc":{"fallback_toast":{"content":"自定义:出现了奇怪的问题"},"min_version":"7.3.0","support":true}}}]},"elements":[{"actions":[{"behaviors":[{"android_url":"https://developer.android.com/","default_url":"https://www.baidu.com","ios_url":"https://www.baidu.com","pc_url":"https://www.windows.com","type":"open_url"},{"client_channel":"test__card","type":"client_message","value":"button-001"},{"type":"callback","value":{"elements":[{"content":"This is a blank card content.","tag":"markdown"},{"fields":[{"is_short":true,"text":{"content":"**🗳工单来源:**\n报事报修","tag":"lark_md"}},{"is_short":true,"text":{"content":"**📝工单类型:**\n客服工单","tag":"lark_md"}}],"tag":"div"}]}}],"confirm":{"text":{"content":"content","tag":"plain_text"},"title":{"content":"title","tag":"plain_text"}},"multi_url":{"android_url":"","ios_url":"","pc_url":"","url":"飞书开放平台"},"tag":"button","text":{"content":"主按钮","tag":"plain_text"},"type":"primary"}],"tag":"action"}]}`	
	return str1.length === str2.length
}
ready
compare content
function test() {
	const str1 = `111UserDSL:
{"config":{"client_channel_configs":[{"client_channel":"test__card","platform_config":{"android":{"fallback_toast":{"content":"自定义:出现了奇怪的问题"},"min_version":"7.3.0","support":true},"ios":{"fallback_toast":{"content":"自定义:出现了奇怪的问题"},"min_version":"7.3.0","support":true},"ipad":{"fallback_toast":{"content":"自定义:出现了奇怪的问题"},"min_version":"7.3.0","support":true},"pc":{"fallback_toast":{"content":"自定义:出现了奇怪的问题"},"min_version":"7.3.0","support":true}}}]},"elements":[{"actions":[{"behaviors":[{"android_url":"https://developer.android.com/","default_url":"https://www.baidu.com","ios_url":"https://www.baidu.com","pc_url":"https://www.windows.com","type":"open_url"},{"client_channel":"test__card","type":"client_message","value":"button-001"},{"type":"callback","value":{"elements":[{"content":"This is a blank card content.","tag":"markdown"},{"fields":[{"is_short":true,"text":{"content":"**🗳工单来源:**\n报事报修","tag":"lark_md"}},{"is_short":true,"text":{"content":"**📝工单类型:**\n客服工单","tag":"lark_md"}}],"tag":"div"}]}}],"confirm":{"text":{"content":"content","tag":"plain_text"},"title":{"content":"title","tag":"plain_text"}},"multi_url":{"android_url":"","ios_url":"","pc_url":"","url":"飞书开放平台"},"tag":"button","text":{"content":"主按钮","tag":"plain_text"},"type":"primary"}],"tag":"action"}]}`
	const str2 = `UserDSL:
{"config":{"client_channel_configs":[{"client_channel":"test__card","platform_config":{"android":{"fallback_toast":{"content":"自定义:出现了奇怪的问题"},"min_version":"7.3.0","support":true},"ios":{"fallback_toast":{"content":"自定义:出现了奇怪的问题"},"min_version":"7.3.0","support":true},"ipad":{"fallback_toast":{"content":"自定义:出现了奇怪的问题"},"min_version":"7.3.0","support":true},"pc":{"fallback_toast":{"content":"自定义:出现了奇怪的问题"},"min_version":"7.3.0","support":true}}}]},"elements":[{"actions":[{"behaviors":[{"android_url":"https://developer.android.com/","default_url":"https://www.baidu.com","ios_url":"https://www.baidu.com","pc_url":"https://www.windows.com","type":"open_url"},{"client_channel":"test__card","type":"client_message","value":"button-001"},{"type":"callback","value":{"elements":[{"content":"This is a blank card content.","tag":"markdown"},{"fields":[{"is_short":true,"text":{"content":"**🗳工单来源:**\n报事报修","tag":"lark_md"}},{"is_short":true,"text":{"content":"**📝工单类型:**\n客服工单","tag":"lark_md"}}],"tag":"div"}]}}],"confirm":{"text":{"content":"content","tag":"plain_text"},"title":{"content":"title","tag":"plain_text"}},"multi_url":{"android_url":"","ios_url":"","pc_url":"","url":"飞书开放平台"},"tag":"button","text":{"content":"主按钮","tag":"plain_text"},"type":"primary"}],"tag":"action"}]}`	
	return str1=== str2
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.