Gerold55 / laptop

Introducing the MineTest Laptop Mod
Other
25 stars 14 forks source link

Mtos cache in ram to boost performance #121

Closed bell07 closed 6 years ago

bell07 commented 6 years ago

Before this change for each action the the nodemeta was read and the "Operating system" object restored. After the action processing the nodemeta was saved to node and objec gets lost.

Now an Lua-table is used to cache the "Operating system" instances to avoid unnecessary reads and wirtes to nodemeta. For some operations the full sync is forced (like inserting disk) but usual the "Operating system" instance is cached till 5 seconds not used.

The most noticable performance boost is in tetris app because the game requests the OS 3x per second

The drawback is in case the server crashes maybe some changes are not stored.

@Gerold55 @Grizzly-Adam @apachano please thest the changes intensive before we can merge them

bell07 commented 6 years ago

I updated also my master with all open changes ("Beta") so you can use the repo to test all open changes

Grizzly-Adam commented 6 years ago

I was going to ask about tetris as soon as I saw the title. Looking forward to trying this.

On Thu, Mar 22, 2018 at 8:56 AM, bell07 notifications@github.com wrote:

I updated also my master with all open changes ("Beta") so you can use the repo to test all open changes

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Gerold55/minetest-laptop/pull/121#issuecomment-375314765, or mute the thread https://github.com/notifications/unsubscribe-auth/AhktCbBkOKWiOC40qhiDCBz-V60koOPUks5tg62XgaJpZM4S3FVq .

bell07 commented 6 years ago

Bug found picking laptop up and place again results in data loss. Investigating...

bell07 commented 6 years ago

The save of OS state on laptop pickup to itemmeta does work proper now from cached OS

bell07 commented 6 years ago

Added some additional forced sync's: if app changed, 5 seconds idle (as before) or each 15 seconds in usage.

Now the changes are "safe enough" for me to be merged.

Did anyone tested the changes? Please take additional tests after the last changes. If nothing bad happens, the change could be merged.

I realize that we can be held responsible for data security of in laptop stored informations, if a bug deletes the whole data of all laptops :-/

Grizzly-Adam commented 6 years ago

I tested your updated from a couple weeka ago with no ill effect. Will try to find time to test this version tonight.

On Wed, Apr 4, 2018 at 2:34 PM, bell07 notifications@github.com wrote:

Added some additional forced sync's: if app changed, 5 seconds idle (as before) or each 15 seconds in usage.

Now the changes are "safe enough" for me to be merged.

Did anyone tested the changes? Please take additional tests after the last changes. If nothing bad happens, the change could be merged.

I realize that we can be held responsible for data security of in laptop stored informations, if a bug deletes the whole data of all laptops :-/

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Gerold55/minetest-laptop/pull/121#issuecomment-378719130, or mute the thread https://github.com/notifications/unsubscribe-auth/AhktCcPmXVCrrVcZL7epGAGQbmFFCdhmks5tlSA6gaJpZM4S3FVq .