Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use common sql to run benchmark #326

Merged
merged 3 commits into from
Jul 23, 2024

Conversation

JackWang032
Copy link
Collaborator

@JackWang032 JackWang032 commented Jun 28, 2024

修改内容

  1. 使用通用SQL作为基准测试测试用例
  2. 基准测试会对数据进行异常值筛选
  3. 基准测试配置项提取到benchmark.config.ts中

测试数据

  1. 尽量使用通用性强的SQL,不同语言测试的SQL应在复杂度,嵌套层级上基本一致
  2. SQL保持规模在1000行左右
  3. 覆盖不同类型语句, create.sql、select.sql、insert.sql、update.sql、split.sql、suggestion.sql

不同方法对应的测试用例

  1. getAllTokens: create.sql、select.sql、insert.sql、update.sql
  2. validate: create.sql、select.sql、insert.sql、update.sql
  3. splitSQLByStatement: split.sql
  4. getAllEntities: suggestion.sql
  5. getSuggestionAtCaretPosition: suggestion.sql

注意事项

为了保证每次运行都是冷启动,使用了 delete require.module方式来清除模块缓存,这种方式会造成内存泄漏issues/8443,运行全部语言时会越跑越慢,node v21.x版本中解决了这个问题,所以在跑基准测试时最好通过 nvm 切换 node 版本至 v21.6.1 去跑

@JackWang032 JackWang032 marked this pull request as ready for review July 4, 2024 11:19
@HaydenOrz HaydenOrz merged commit 76d0900 into DTStack:main Jul 23, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants