#11 Cleaning redis service and adding ttl getter method

已合并
jonathan 4 年前 将 4 次代码提交从 kris/refactor_redis_service合并至 master
kris 评论于 4 年前
这个人很懒,什么都没留下。
kris4 年前 修改标题 WIP: (testing) Cleaning redis serviceCleaning redis service adn adding ttl getter method
kris 评论于 4 年前
发布者

@jonathan please review

@jonathan please review
jonathan4 年前kris 指派
kris4 年前 修改标题 Cleaning redis service adn adding ttl getter methodCleaning redis service and adding ttl getter method
jonathan 评论于 4 年前
所有者

@kris -- Things that make me wary:

  • use of var in a low-level library. The lower you go, the more explicit types should be. Why introduce another potential source of errors? Can we remove var and replace with class names?
  • use of streams/lambdas/collecting and in general anywhere we are now creating new objects when we could have avoided it. low level libraries should generally prefer for-loops and static classes. Can you review and avoid using stream methods and allocating new objects where possible?

Please give me a heads-up in advance before refactoring more library code. With the above changes I will merge this, but frankly I don’t see a big benefit given the risk. If we had more comprehensive test coverage I would feel better about the risk.

@kris -- Things that make me wary: * use of `var` in a low-level library. The lower you go, the more explicit types should be. Why introduce another potential source of errors? Can we remove `var` and replace with class names? * use of streams/lambdas/collecting and in general anywhere we are now creating new objects when we could have avoided it. low level libraries should generally prefer for-loops and static classes. Can you review and avoid using stream methods and allocating new objects where possible? Please give me a heads-up in advance before refactoring more library code. With the above changes I will merge this, but frankly I don't see a big benefit given the risk. If we had more comprehensive test coverage I would feel better about the risk.
kris 评论于 4 年前
发布者
  • Removing var (only String was replaced in 5ish places, so it was easy) - agree, sorry
  • stream/lambda/collect is used just in 1 place - method prefix(Collection<String>). In master (current version) following is used transform(keys, o -> prefix(o.toString())) - so lambda is there also. I did some perfomance test on this, and the new solution worked 2x faster at least on collections with 10.000 Strings. Please confirm you really want apache’s transform method back. Or maybe to just change all this and use plain for loop with another collection created as output?
- Removing var (only String was replaced in 5ish places, so it was easy) - agree, sorry - stream/lambda/collect is used just in 1 place - method `prefix(Collection<String>)`. In master (current version) following is used `transform(keys, o -> prefix(o.toString()))` - so lambda is there also. I did some perfomance test on this, and the new solution worked 2x faster at least on collections with 10.000 Strings. Please confirm you really want apache's transform method back. Or maybe to just change all this and use plain for loop with another collection created as output?
jonathan 关闭此合并请求 4 年前
jonathan4 年前 删除了分支 kris/refactor_redis_service
该合并请求已作为 5d199cbd98 被合并。
登录 并参与到对话中。
无审核者
未选择标签
未选择里程碑
未指派成员
2 名参与者
通知
到期时间

未设置到期时间。

依赖工单

此合并请求当前没有任何依赖。

正在加载...
这个人很懒,什么都没留下。