fusesource / jansi

Jansi is a small java library that allows you to use ANSI escape sequences to format your console output which works even on windows.
http://fusesource.github.io/jansi/
Apache License 2.0
1.11k stars 140 forks source link

enhance memory usage using buffer, or avoiding alloc #153

Closed Arnaud-Nauwynck closed 5 years ago

Arnaud-Nauwynck commented 5 years ago

avoid so many conversions of char -> to String -> getChars() -> copy chars -> foreach char -> to String -> getChars ...

also use bigger buffer... as printed log line usually got more than 50 chars.. not 16 as default in StringBuilder constructor (with 16 chars, you can write "Hello World !!!!" )

hboutemy commented 5 years ago

good idea, thanks

hboutemy commented 5 years ago

sadly merged without testing myself and found that the patch was wrong :(