collinsmith / riiablo

Diablo II remade using Java and LibGDX
http://riiablo.com
Apache License 2.0
895 stars 101 forks source link

Add support for pooling in logger package #107

Closed collinsmith closed 4 years ago

collinsmith commented 4 years ago

Some tuples within com.riiablo.logger could be pooled to reduce allocation. Easy ones could be Message and LogEvent, but there could be more.

As an aside, if Message is pooled, it should also come with support for methods with fixed numbers of parameters to remove array allocations, including adding those to Logger. Tons of boilerplate code, since this is project-specific, I'd say 8 parameters max, but maybe less. For example:

void errorf(String);
void errorf(String,Object);
void errorf(String,Object,Object);