ghost-discord / ghost

🤖 A modular, multi-feature Discord bot
GNU General Public License v3.0
23 stars 31 forks source link

Replace `String.format()` calls #13

Closed zzzowoey closed 5 years ago

zzzowoey commented 5 years ago

The performance of String.format() is apparently really, really bad. Calls to the method should be replaced with the + operator or a StringBuilder across the project.

String concatenation performance

Smirne commented 5 years ago

In this case I don't think this will have much impact, String.format is always used with few parameters and never in loops or frequently recurring calls. Anyway it might be worth changing to enforce best practices in the future.

zzzowoey commented 5 years ago

I agree, at least for this project. If ghost2 was significantly larger it'd likely have at least a somewhat noticeable impact on performance considering how much I made use of it before.