The Xojo shell class is inefficient

It might be more respectful to Sam to start your own thread.

2 Likes

Sm has no Solution written in plain Xojo. He only got out that there is a problem and he described the problem. And he described that he wants only a Solution with Xojo by self so he wants to use Declares. That was described. Nothing else. So which Solution he should provide now? There is non, the Xojo Solution is not existent and that MBS will be able to present a Solution is no question. But also it will be no question that MBS will have the possibility to present a solution. But that is not part of the described problem.

1 Like

oki, you have any point ? are you making any sense ? beside repeating what the OP said first

Did you get what I said? No. Go home.

If I wouldn’t be polite I would write something else. But so I only say: nobody is interested in that you want to say. And if: I have an Idea. You can do with all your friends here your own Forum. Do that. While it will help you to get to the people which want to read what you have top say. Ah, yes, there is nobody. Then: write in your Forum for NOBODY. At least we don’t have to read what you are getting out of your brain.

2 Likes

In keeping this thread on track.

After performing longer tests, I sadly found that the most efficient method of using NSTask, runs into problems (after several hours).

What was really incredible (and exciting) was to see the scoreboard, how my app went from being one of the most energy hungry, to almost at the bottom of the list, using less energy than many system daemons.

Therefore I’ve been testing my second most efficient method, which also uses NSTask.

Compiled App - Testing time is 1 minute.
Xojo Shell: ~ 50,000 wakeups, ~3.5 seconds of a CPU time.
NSTask (Most efficient): ~ 12 wakeups, as low as 0.01 seconds of CPU time…
NSTask (2nd efficient): ~ 20 wakups, as low as 0.06 seconds of CPU time.

Over the long tests, I don’t expect such incredible results (as most efficient), but hopefully it remains stable and continues to keep my energy usage as little as possible.

The work I’ve done over the last 13 months has been used to identify energy issues in several major brands of software, including (but not limited too) both Apple and Microsoft. As these issues are corrected, people can squeeze more battery life outa their laptops, reduce their energy footprint, etc, etc…

The current line of work that started two months ago (and led to this very thread), has highlighted energy issues in my own apps and other 3rd party apps. The popular web browser Firefox is among this group.

I am still disappointed in how several members have acted. Plagiarism, forum spamming and personal insults are totally acceptable behavior, but politely asking the forum spammer to cease, is a crime against humanity.

6 Likes

Only as a simple compare: I also wrote test with Xojo and one with Java. The result is comparable to your results. In general: java is a bit less efficient compared to Xcode written Program (16 wakeups as los as 0,01 seconds of CPU time (the NSTask) and 19 wakeups and 0,03 seconds CPU Time (The same as a Java variant).

So I got interested and tried to compare on a windows machine with C++ and I got out, that the same kind of behavior is also to find on Windows. Especially the time for starting up the shell and waiting for the shell result. And again also here Java is a bit slower than C++ what I expected also like that.

Looking on it I will ask Christian to allow me to use his Shell Plugin for testing also so I can get a result how his Plugin is behaving under the same testing conditions.

The whole Result is: Xojo should rewrite the shell Class cause it IS inefficient and holds the computer in a higher level of energy consume for sure and also “eats” cpu performance. At least more as it needs for the computer to build up a shell functionality. In my view it should be like

1 Like

Excellent work @thorstenstueker I am really pleased that I have inspired you and thank you for taking the time to share your effort with the community.

I now have the results for some tests within the actual application. Here I am not tracking wakeups, only CPU usage (duration of the tests were not identical, longest was 16 hours).

Xojo Shell: 5.64% CPU usage.
NSTask (most efficient): 0.02% CPU usage.
NSTask (2nd Efficient): 0.11% CPU usage.

I am very pleased with the results of the 2nd Efficient NSTask method, it’s reduced my apps energy usage by 98%. With the right information, we can convert these results into a dollar amount.

Clarification: Dollars saved by reducing energy usage.

2 Likes

Mr. Dalu. It is spam what you do here
Not more.

I am not a hater. The difference is: you are. and you believe that you are the best man of universe. You are not. Look on your Support Site. Nobody needs it at all. Nobody cares. And nothing what you presented until now was really with to read. We discuss technology here and not things you mean are not fair. We are fair. Especially while we let people discuss.

And yes: I decided in that time to leave. Why? While there were internal discussions. And this internal discussions ended in a positive wise. Not all what you think is the entire theme is really the entire theme.

Beside that: I would prefer in your place to get the buggy hints our of my forum. Not all you copied from Xojo Forum is without Bugs you should care about it.

Thanks a lot for pointing to the NSTask solution, Sam!
I was not that successful, turning the Postgres materialised view refresh and a few notifications into a NSTask driven helper, but at least CPU hunger dropped to about half and reactivations are also down to about 20 when run in QOS background mode.

By assigning different M1 cores, did you mean the QOS property? Or did I miss another NSTask feature? I wonder if I could somehow reduce the activity even more; the helper is most of the time just hanging around waiting for the SQLExecute to finish.

1 Like

Yes, indeed. I got this tip from Howard’s article How to run commands and scripts on Efficiency cores – The Eclectic Light Company

For that I don’t know sorry, I use SQLite, but my experience isn’t that deep.

@thorstenstueker save yourself some hassle, you can get the forum software to auto hide posts from certain people.

Click the icon in the top right hand corner of the site (your avatar).
Select “Preferences” from the drop down menu.
Click on “Preferences” again.
Then Click “Users” in the left hand side bar.
Click on “+ Add” under the “Ignore” section and start typing the user name of the person whom you no longer want to see anything from.
Select their name and you’ll no longer be exposed to their “content”.

So as far as I can see you set me as a Jew in one row with Russians and Nazis. That is unacceptable. Sorry but that is not acceptable.

3 Likes

If you read carefully, he did said ‘a simple NSTask (via declares, so I know what’s going on)’.
That implies he has code, with declares to use NSTasl. So it would be great if Sam shares that code. That would be helpful to the community, something NPalardy was asking for.

Actually Norma was not asking Sam for Code but Christian for Code Examples but okay. And declares are described in Xojo Docs, the rest is simple. Also the declares by self are simple. So I guess that is nothing Norman has to ask for. Simply calling the declare.

A different situation is with the Plugin. The Plugin has its own Logic and its own functionality. So I can’t see that what you tried to describe. Would be nice if you cite that so I can see the exact position cause I did not found anything like you described.

It would be nice - I certainly wouldn’t say its required

But he may NOT be able to if the code is in a work for hire for a client who wants to retain copyright etc

It is possible I could share the source code, but I have to decide what I want from doing so.

I can copy paste the action method, the callback and the termination code. But it won’t be useful, unless you have the latest copy of my internal library. Nearly all of my declares are External Methods in modules (allowing unused declares can be stripped, while also being available in multiple places).

So I’d have to create a demo project that includes just those declares as I’m not comfortable publicly sharing my internal library at this moment.

1 Like

There is no need for. I have the same or nearly the same results with Declares with my Library which I will set to open Source within the next two weeks so everybody can test and use by self for his Projects. So it is not needed to expose your Sourcecode. I have also the permission from Monkeybread Software for testing his Plugins for efficiency in this Case so I can bring a complete testing Suite for this case. I hope that it will bring you out of this critical situation.

1 Like

While it would be NICE do NOT feel obliged to share

Share on the terms YOU’RE ok with

1 Like