-
Notifications
You must be signed in to change notification settings - Fork 229
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
optimize: latencyString shows realLatency(+offset) #307
optimize: latencyString shows realLatency(+offset) #307
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
虽然可以……但为什么每次都要把 map 里的 offset 取出来存进 o 成员里?
c94f568
to
268f3e7
Compare
umm, 不确定你指的具体是哪一行。 如果是指 127~128 行的话, 那是因为 l 和 o 在排序和显示的时候都会用到,所以就直接放进 alive 里? |
直接用 offset 变量也可以? |
如果是显示的话,可以调 map 再拿一遍 |
具体是哪一段,可以指定行评论咩? |
f290690
to
e2df89e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Node 1 227ms(+500ms=727ms) 这样展示你觉得如何? |
看起来是的, 我不确定是否是我这个变更引入的问题,请问我应该怎么本地测试比较推荐? |
可以。 |
这是因为 re-selects 的时候是使用的 .l 而不是 .l+.o,请检查一下所有的引用。 实际上,我们没有必要改变之前的行为,没有必要引入 .o,只需要去掉 epsilon 那部分的 >0 判断即可。 |
本地测试:
|
OK, 我尝试修复一下 |
@luochen1990 我看了一下代码,因为有 clamp(钳制到 Timeout 以内),所以想要 reverse 回去按照原来的思路似乎是不可行的。需要保存之前的 latency,使用你的这套代码是正确的。 |
确认一下, re-selects 是在 calcMinLatency 这里么? |
是的。 |
我感觉可能需要重构一下, 因为涉及 latency 的地方有点多,我打算引入一个
你觉得 OK 么? 因为这个动作可能有点大, 我不确定你觉得是否OK |
@luochen1990 没问题 |
![]() LGTM. 待 PR Build #307 运行完毕后,你也可以测试一下。 |
LGTM. 非常感谢! |
感谢你分享这么好用的软件, 非常荣幸能贡献代码 :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧪 Since the PR has been fully tested, please consider merging it.
Background
this PR make latencyString() shows latency like
realLatency(+offset)
instead oflatencyAfterOffset(latencyBeforeOffset)
Checklist
Full Changelogs
Issue Reference
Closes #[issue number]
Test Result