On Thu, 31 Aug 2023 02:36:09 GMT, 温绍锦 <d...@openjdk.org> wrote:

>> 温绍锦 has updated the pull request incrementally with one additional commit 
>> since the last revision:
>> 
>>   assert bounds check
>
> @cl4es can you help me to review this PR?

> @wenshao How about of approach used in [James Anhalt's 
> algorithm](https://jk-jeon.github.io/posts/2022/02/jeaiii-algorithm/)?
> 
> It reduces number of multiplications ([and store operations in case of 
> writing by 4-8 byte 
> words](https://github.com/plokhotnyuk/jsoniter-scala/blob/b1020bafa7e2e5b7e8dd87b86a9e860975f4695e/jsoniter-scala-core/jvm/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core/JsonWriter.scala#L2004-L2023))
>  but increases the total number of instructions for the routine.

If the compiled code size is greater than 325 (FreqInlineSize), it will not be 
inlined and performance will slow down. This algorithm obviously greater than 
325.

different algorithms perform differently on different types of tiny/small/big 
values.

The [first 
commit](https://github.com/openjdk/jdk/pull/14699/files/8bdda26b8bb7f6162592a07445ecd2285e4fabaa)
 of this PR performs better under big values. But I still use the current 
algorithm, with few changes, and performance can be improved in all scenarios.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/14699#issuecomment-1702637851

Reply via email to