Falcosc / locus-addon-tasker

Locus Maps API useable as Tasker Plugin
GNU General Public License v3.0
9 stars 2 forks source link

Cost of "Request sensors and stats"? #16

Open TapioOfTapiola opened 3 years ago

TapioOfTapiola commented 3 years ago

I was always wondering, if extensive use of (subject) is expensive on cpu/battery or totally harmless...? What if I have the idea to check many data every 5 seconds? Does it make a difference if I get only is_track_rec_recording, or 20 others at the same time?

Just wondering. I am always very conservative in my scripting, but maybe you know that pulling data is negligibly cheap...

thx

TapioOfTapiola commented 3 years ago

In other words, if it was as cheap as e. g. a single "variable set", I wouldn't have to think about it any more...

Falcosc commented 3 years ago

Request sensors and stats maybe is expensive. Locus can only send all or nothing. For that reason I do cache the result for 1000ms. So in reality you are fine with executing it multiple times.

But I don't know how expensive it is to process the Fields in Tasker. I give tasker the requests key value pairs and don't know how much stuff does happen to them.

You should benchmark is to find the real numbers. It could be that Tasker does take 20 times more CPU cylces and Locus Maps does take 10 times more CPU Cycles then the request sensor task.

Just collect the Process ID from Tasker, LocusMaps and the plugin. (Tasker may have multiple Process IDs, you need to check what happens during Task execution) And with the Process IDs you can collect the used CPU cycles in User time and System Time. /proc/<PID>/stat

I did this to check why I couldn't reach my benchmarked battery runtimes in the real word: https://help.locusmap.eu/topic/cpu-time-increase-after-long-runtime

TapioOfTapiola commented 3 years ago

Impressive testing, will read your findings. I noticed you also wished for "set map via preset". This was a topic a few weeks ago, Menion is almost convinced, problem is, he sees Maps as data, not settings.. Aber er wackelt, will er später entscheiden, vielleicht kannst Du ihn nochmal kneifen 😁

TapioOfTapiola commented 3 years ago

So yeah, does Locus do any map rendering if I just started recording via an intent? In that case, setting a blank map via preset would be even more interesting for me.