Skip to content

Microbenchmarks on Sequence::toSet and Sequence::toList implementations

License

Notifications You must be signed in to change notification settings

fzhinkin/sequence-benchmarks

Repository files navigation

Sequence::toList and Sequence::toSet benchmarks

Benchmarks compare performance of existing implementations of Sequence::toSet and Sequence::toList extension functions with optimized version that avoids allocation of underlying collection when possible.

Optimized implementations are based on proposal from KT-55091.

Measurements were performed using JDK-8 and JDK-11 on a host with Apple M2 Max CPU.

The only varying parameter size affect the size of a sequence transformed to either a list, or a set depending on a particular benchmark.

Results

JDK-8

Throughput

Allocation rate

JDK-11

Throughput

Allocation rate

Conclusions

Optimized implementations of Sequence::toList and Sequence::toSet should either superior, or the same performance as existing implementation. Optimized implementations also reduce allocation rate (as expected).

About

Microbenchmarks on Sequence::toSet and Sequence::toList implementations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages