#11 Cleaning redis service and adding ttl getter method

Fusionnée
jonathan a fusionné 4 révision(s) à partir de kris/refactor_redis_service vers master il y a 4 ans
kris a commenté il y a 4 ans
Il n'existe pas encore de contenu.
kris a modifié le titre de WIP: (testing) Cleaning redis service à Cleaning redis service adn adding ttl getter method il y a 4 ans
kris a commenté il y a 4 ans
Publier

@jonathan please review

@jonathan please review
jonathan s'est vu assigner cela par kris il y a 4 ans
kris a modifié le titre de Cleaning redis service adn adding ttl getter method à Cleaning redis service and adding ttl getter method il y a 4 ans
jonathan a commenté il y a 4 ans
Propriétaire

@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 a commenté il y a 4 ans
Publier
  • 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 a fermé cette pull request il y a 4 ans
jonathan a supprimé la branche kris/refactor_redis_service il y a 4 ans
La demande de tirage a été fusionnée en 5d199cbd98.
Connectez-vous pour rejoindre cette conversation.
Pas de relecteur
Pas d'étiquette
Aucun jalon
Pas d'assignataires
2 participants
Notifications
Échéance

Aucune échéance n'a été définie.

Dépendances

La demande de fusion n'a actuellement pas de dépendance.

Chargement…
Il n'existe pas encore de contenu.