#11 Cleaning redis service and adding ttl getter method

Zusammengeführt
jonathan hat 4 Commits von kris/refactor_redis_service nach master vor 4 Jahren zusammengeführt
kris hat vor 4 Jahren kommentiert
Hier gibt es bis jetzt noch keinen Inhalt.
kris hat den Titel von WIP: (testing) Cleaning redis service zu Cleaning redis service adn adding ttl getter method vor 4 Jahren geändert
kris hat vor 4 Jahren kommentiert
Ersteller

@jonathan please review

@jonathan please review
jonathan wurde von kris vor 4 Jahren zugewiesen
kris hat den Titel von Cleaning redis service adn adding ttl getter method zu Cleaning redis service and adding ttl getter method vor 4 Jahren geändert
jonathan hat vor 4 Jahren kommentiert
Besitzer

@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 hat vor 4 Jahren kommentiert
Ersteller
  • 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 hat diesen Pull-Request vor 4 Jahren geschlossen
jonathan löschte die Branch kris/refactor_redis_service vor 4 Jahren
Der Pull Request wurde als 5d199cbd98 zusammengeführt.
Anmelden, um an der Diskussion teilzunehmen.
Keine Reviewer
Kein Label
Kein Meilenstein
Niemand zuständig
2 Beteiligte
Nachrichten
Fällig am

Kein Fälligkeitsdatum gesetzt.

Abhängigkeiten

Dieser Pull-Request hat momentan keine Abhängigkeiten.

Laden…
Hier gibt es bis jetzt noch keinen Inhalt.