mo8it,
@mo8it@fosstodon.org avatar

performance tip 🚀

If you want to update the value of a String, it is more efficient to recycle the existing allocation with clear and write* instead of reallocating with format! ♻️

shows that the method with format! has one allocation while the other one doesn't 😃

Divan output:

  • All
  • Subscribed
  • Moderated
  • Favorites
  • rust
  • tacticalgear
  • DreamBathrooms
  • cisconetworking
  • khanakhh
  • mdbf
  • magazineikmin
  • modclub
  • InstantRegret
  • rosin
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • ngwrru68w68
  • JUstTest
  • everett
  • tester
  • cubers
  • normalnudes
  • thenastyranch
  • osvaldo12
  • GTA5RPClips
  • ethstaker
  • Leos
  • provamag3
  • anitta
  • megavids
  • lostlight
  • All magazines