#11 Cleaning redis service and adding ttl getter method

Sammanfogat
jonathan sammanfogade 4 incheckningar från kris/refactor_redis_service in i master 4 år sedan
kris kommenterad 4 år sedan
Det finns inget innehåll än.
kris ändrade titeln från WIP: (testing) Cleaning redis service till Cleaning redis service adn adding ttl getter method 4 år sedan
kris kommenterad 4 år sedan
Skapare

@jonathan please review

@jonathan please review
jonathan blev tilldelad denna av kris 4 år sedan
kris ändrade titeln från Cleaning redis service adn adding ttl getter method till Cleaning redis service and adding ttl getter method 4 år sedan
jonathan kommenterad 4 år sedan
Ägare

@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 kommenterad 4 år sedan
Skapare
  • 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 closed this pull request 4 år sedan
jonathan tog bort grenen kris/refactor_redis_service 4 år sedan
Pull-förfrågan har sammanfogats som 5d199cbd98.
Logga in för att delta i denna konversation.
Inga granskare
Ingen Etikett
Ingen Milsten
Ingen tilldelad
2 Deltagare
Notiser
Förfallodatum

Inget förfallodatum satt.

Beroenden

Denna pull-förfrågan har för närvarande inga beroenden.

Laddar…
Det finns inget innehåll än.