Skip to content

Make Move Ordered#24

Merged
niklasf merged 1 commit intolichess-org:masterfrom
isaacl:moveOrdered
Nov 9, 2025
Merged

Make Move Ordered#24
niklasf merged 1 commit intolichess-org:masterfrom
isaacl:moveOrdered

Conversation

@isaacl
Copy link
Copy Markdown
Member

@isaacl isaacl commented Nov 9, 2025

Use a natural ordering on Move rather than an external comparator. This improves readability, but also jmh benchmarks by about 10%.

Use a natural ordering on Move rather than
an external comparator. This improves readability,
but also jmh benchmarks by about 10%.
@isaacl isaacl requested a review from niklasf November 9, 2025 19:20
@niklasf
Copy link
Copy Markdown
Member

niklasf commented Nov 9, 2025

I don't see the benchmark improvement at all (running with lots of forks to deal with the bimodal distribution). But it is more readable ...

@niklasf niklasf merged commit 7621e97 into lichess-org:master Nov 9, 2025
1 check passed
@isaacl
Copy link
Copy Markdown
Member Author

isaacl commented Nov 10, 2025

jmh on HuffmanPgnBench.decode is oddly bimodal. During a fork's runs, the times are consistent, but different forks/runs are not consistent.

$ sbt 'project benchmarks; jmh:run -wi 1 -i 3 -f10 HuffmanPgnBench.decode'

before PR:

  • 9 forks are 7.00ms/op
  • 1 fork is 5.66ms/op

with PR:

  • 7 forks are 6.75ms/op
  • 3 forks are 4.98ms/op

So, on my machine, the 'good' runs are 10% faster locally, and the 'bad' runs are about 5% faster.

@isaacl
Copy link
Copy Markdown
Member Author

isaacl commented Nov 10, 2025

But this is the second PR here where I saw improvements locally and the other person didn't... so idk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants