#1 Make computing easier and faster

Closed
Zweihorn wants to merge 2 commits from Zweihorn/improved_computing into TenPlus1/master

To lower the burden to the Lua interpreter make computing easier and faster by:

  • avoid nested division in toolranks.new_afteruse
  • check most frequent range of uses first not last in toolranks.get_level(uses)

Presumably, players will tend to use most frequently the tools with high wearout over ones with low wear to enjoy the positive effects of toolrank.

The function toolranks.new_afteruse is called for every use of the certain tools used by the player. The function toolranks.get_level(uses) is called from toolranks.new_afteruse every time by default.

Hope this helps.

To lower the burden to the Lua interpreter make computing easier and faster by: - avoid nested division in `toolranks.new_afteruse` - check most frequent range of `uses` first not last in `toolranks.get_level(uses)` Presumably, players will tend to use most frequently the tools with high wearout over ones with low wear to enjoy the positive effects of toolrank. The function `toolranks.new_afteruse` is called for every use of the certain tools used by the player. The function `toolranks.get_level(uses)` is called from `toolranks.new_afteruse` every time by default. Hope this helps.
TenPlus1 commented 10 months ago
Owner

Using 1 billion iterations:

wear = digparams.wear / (1 + level / 4) [2.3442 seconds]

wear = digparams.wear * 4 / (4 + level) [2.0184 seconds]

Negligible change in speed but hey, will make the change :) Thanks :P

Using 1 billion iterations: wear = digparams.wear / (1 + level / 4) [2.3442 seconds] wear = digparams.wear * 4 / (4 + level) [2.0184 seconds] Negligible change in speed but hey, will make the change :) Thanks :P
Zweihorn commented 10 months ago
Poster

THX :-)

N.B. The factor is 0.86 so almost 14 % faster (or better as there should be an overhead deductable from both rates).

THX :-) N.B. The factor is 0.86 so almost 14 % faster (or better as there should be an overhead deductable from both rates).
Please reopen this pull request to perform merge operation.
Sign in to join this conversation.
No Label
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.