hgeorgsch / armchar-swish

ArM character server implementation using Haskell and Swish
GNU General Public License v3.0
0 stars 1 forks source link

Speed up advancement #96

Closed hgeorgsch closed 2 years ago

hgeorgsch commented 2 years ago

This will also help for #94 . Can we speed up advancement calculation, possibly by working directly on RDF graphs. There are several obstacles.

  1. Traits must be merged, which is ok, but then addedXP needs to be merged with totalXP at the same time. XPScore and hasXP can be deferred to the Record rules. This is tricky, because the obvious merger traverse two sorted lists of triples selecting from one of the, but addedXP/totalXP are different triples which may not be adjacent in the sort order
  2. Repeatable traits need to be handled, but this may be an issue even with the existing advancement logic.
hgeorgsch commented 2 years ago

Repeatable traits is also the concern in #95 , which should probably be resolved first.

hgeorgsch commented 2 years ago

When other critical issues are solved, we need to remove debug tracing and test performance. This is a critical step, after which we can assess the need for further improvement.

hgeorgsch commented 2 years ago

Startup is now down to 100 CPU-seconds on shannon, compared ~113 before the refactoring. Further improvements may be possible when we review the code. #100 CPU load is under 200%, so it is possible that further parallellisation may work too. The put script takes ~170 CPU second on the server.

hgeorgsch commented 2 years ago

New tests show a r/t improvement from 1'06s to 40s on the put script. No improvement on the other scripts, and no improvement on CPU time, but the latter is difficult to measure.

hgeorgsch commented 2 years ago

THere does not seem to be more to do here. Further speedups must be found elsewhere.