[slf4j-dev] Several improvements in MessageFormatter

Ceki Gülcü ceki at qos.ch
Mon Feb 20 20:25:09 CET 2017


Sorry about that. The link seems to be protected.

By single pass, I mean format by looking at one character at a time and 
keeping state.

--
Ceki


On 2/20/2017 20:08, Николай Федоровских wrote:
> Hi Ceki,
>
> Thanks for the answer. Unfortunately your link return a 404. That do
> you mean by a "single pass" implementation? If you mean a replace many
> calling indexOf() on simple chars iterate - yes, I can do this (with
> benchmarks of course).
>
> ----
> Regards,
> Nikolay Fedorovskikh.
>
> 2017-02-20 15:19 GMT+05:00 Ceki Gülcü <ceki at qos.ch>:
>>
>> Hi Nikolay,
>>
>> Thank for the PR. However, there's too much in it.  Cosmetic changes that
>> touch many lines take me too much time to verify for little added value.
>> Given my workload, I'm not interested in this PR ad it stands.
>>
>> I would suggest that you propose a single change, the one you deem most
>> valuable. This should be relatively easy to do.
>>
>> Alternatively, if you wish to make the exercise more interesting and
>> valuable, I would propose a single pass implementation of the formatting
>> algorithm which should improve performance. See lines 125 to 168 of
>> StrawLog.java [1]. The resulting performance improvement  should be
>> benchmarked to validate improved performance. Otherwise, the change is not
>> worth the trouble.
>>
>> Please let me know what you think.
>>
>> --
>> Ceki
>>
>> [1]
>> https://github.com/stephenc/java-logging-benchmarks/blob/master/logback-fmt/strawman/src/main/java/me/justpitch/loggingbenchmarks/StrawLog.java
>>
>>
>> On 2/19/2017 22:12, Николай Федоровских wrote:
>>>
>>> Hi All,
>>>
>>> I made some optimizations in MessageFormatter such as: avoid redundant
>>> instantiations, replace HashMap to IdentityHashMap, reduce checks for
>>> arrays args, etc.
>>> PR: https://github.com/qos-ch/slf4j/pull/171
>>> Can you look at this, please?
>>>
>>> Thanks!
>>>
>>> ----
>>> Regards,
>>> Nikolay Fedorovskikh.
>>> _______________________________________________
>>> slf4j-dev mailing list
>>> slf4j-dev at qos.ch
>>> http://mailman.qos.ch/mailman/listinfo/slf4j-dev
>>>
>> _______________________________________________
>> slf4j-dev mailing list
>> slf4j-dev at qos.ch
>> http://mailman.qos.ch/mailman/listinfo/slf4j-dev
> _______________________________________________
> slf4j-dev mailing list
> slf4j-dev at qos.ch
> http://mailman.qos.ch/mailman/listinfo/slf4j-dev
>


More information about the slf4j-dev mailing list