Sketchware-Pro / Sketchware-Pro

Sketchware Pro's sources in Java. Now anyone can contribute to Sketchware Pro.
https://sketchware.pro
Other
862 stars 254 forks source link

Performance issues. (Laggy, very slow) #984

Open guhg opened 8 months ago

guhg commented 8 months ago

Issue Description Upon executing the most recent snapshot of Sketchware Pro from the material-redesign branch, a significant degradation in performance was observed. The application exhibits considerable latency, with extended loading times for projects and events, protracted durations for app exports, and frequent crashes. This performance anomaly is particularly unexpected given the robust specifications of the device in use, a Samsung Galaxy Tab S8 equipped with a Snapdragon 8 Gen 1 CPU. The current experience starkly contrasts with the fluidity and efficiency encountered in Sketchware Pro Beta 5, suggesting a regression in performance metrics.

Steps to Replicate To observe the reported behavior, one may:

  1. Launch the latest Sketchware Pro snapshot from the material-redesign branch.
  2. Observe the diminished speed and increased latency within the application.

Anticipated Behavior The expectation for Sketchware Pro is an experience characterized by seamless operation, minimal RAM consumption, and swift interactions with projects, events, and export functions.

Visual Evidence A video demonstrating the issue is available at the provided link: https://drive.google.com/file/d/1r9JFoeu6DEVztKS5MuEqcZd6iSQ1zf0C/view?usp=drivesdk

Device and Application Information

Supplementary Information The scope of this issue's impact, whether isolated to this specific snapshot or more widespread, remains uncertain. However, it is evident that the performance in Sketchware Pro Beta 5 was substantially superior.

ilyassesalama commented 8 months ago

This is the best bug report I've ever seen so far. May I ask, since when this issue started happening? Is it new or old?

guhg commented 8 months ago

Thank you sir. This started happening about a week ago but seems to have gotten worse over the course of several snapshots. Pretty new I'd say.

ilyassesalama commented 8 months ago

I think this issue is device-specific. I tried running the latest snapshot (as of posting this comment) on 4 devices, all of them worked smoothly. Also, keep in mind that the debug version of Sketchware Pro will always be slow since it's not compiled for production. When we're going to release a stable version, it'll be compiled with the production rules to remove any debugging codes.

guhg commented 8 months ago

Yes sir. Thank you. May I ask if you tested it on a Samsung device with a One UI version of 5.0 or greater?

ilyassesalama commented 8 months ago

I haven't tested on Samsung devices. I'll investigate more in this issue if more users are impcated. For now, I don't think I can do anything.

guhg commented 8 months ago

Okay, thank you very much.

Ohyeah66h commented 8 months ago

I have this same issue on my Samsung device but worse. I have the s21 ultra and the latest snapshot is super slow and glitchy.

ilyassesalama commented 8 months ago

Good, I need a few more confirmations from different devices.

JavkhlanK commented 8 months ago

Works fine for me on my SM-S908B, SM-A526B, and SM-A705FN lol. The Galaxy S22 Ultra's running Android 13, security patch level 2023-09-01, the Galaxy A52 5G is running Android 13, security patch level 2023-08-01, and the Galaxy A70 however Android 11, security patch level 2022-12-01.

Maybe your devices were doing other background tasks. For example, opening the app right after installation usually makes it sluggish, but I blame app optimization for that. I waited around 1 min after installing and the app always felt as fluid as ever.
I also have things like Samsung's virus scanner as well as Google Play Protect off. Maybe those were running on your devices.

guhg commented 8 months ago

That's so weird because I tested it on both my friends A14 and my own Galaxy Tab S8 and the sketchware material redesign snapshot performs very poorly and lags as shown in the video. I have no apps in the background and when I roll back to beta 5, no issues at all.

adesonob commented 8 months ago

I'm using it on an A7 Tab, there's a little delay but nothing major.

guhg commented 8 months ago

Yes we are talking about Samsung

ilyassesalama commented 8 months ago

I tested this commit 464522f on Samsung S22, the app works smoother than my Redmi Note 10 Pro. I highly doubt this is related to Samsung devices.

https://github.com/Sketchware-Pro/Sketchware-Pro/assets/46769766/aab18419-9a00-46eb-9708-ae6c9f9a228e

guhg commented 8 months ago

Very odd. Have you tested it on a project with a lot of code, components resources etc? Also it makes no since because my device lags a lot on the material redesign beta. Virus protection is off, no apps are open, and Sketchware beta 5 works perfectly

JavkhlanK commented 8 months ago

Any chance you could share some project(s) with bad performance for you?

guhg commented 8 months ago

Well, those projects are kinda for my company and I wouldn't like releasing the source code if you understand

On Wed, Sep 20, 2023, 4:02 PM Javkhlan K. @.***> wrote:

Any chance you could share some project(s) with bad performance for you?

— Reply to this email directly, view it on GitHub https://github.com/Sketchware-Pro/Sketchware-Pro/issues/984#issuecomment-1728350723, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ3NVF5KOFX2U33WNWSOLKTX3NDWHANCNFSM6AAAAAA45MOJTY . You are receiving this because you authored the thread.Message ID: @.***>

ilyassesalama commented 8 months ago

That's alright. May I ask, I think the app lags for you even in the projects list not just when opening a project, right?

guhg commented 8 months ago

That's alright. May I ask, I think the app lags for you even in the projects list not just when opening a project, right?

Yes, but not all the time. There's random stutters and pages when clicked have a very slight delay. If I roll back to beta 5 everything is fast again though. Just the most annoying thing is when I'm trying to quickly work on a project and when I click on onClick events and onCreate events, it takes a long time and shows a black screen when trying to load a lot of code but it never used to do that

ahmedbarwari commented 7 months ago

this is right, it has been 2 days iam facing this problem, its so sad this is happening i wish someone could figure out the solution, my phone is Samsung a72 and it laggs and so slow even when i open an empty project and it takes aroud 5 seconds just to open an empty OnClick listener

adesonob commented 7 months ago

It's a little delay. I really liked the new design, but even though the delay is small, the important thing is performance.

It may be small for me, but for others it may be a big delay.

guhg commented 7 months ago

Yes, performance is quite bad. Lag while scrolling, slow loading of projects and onClick events, etc. Everything is very slow and laggy.

subhash16 commented 7 months ago

Yes, performance is quite bad. Lag while scrolling, slow loading of projects and onClick events, etc. Everything is very slow and laggy.

Latest snapshot same issue

ilyassesalama commented 7 months ago

Alright, it seems like I’ve got enough reports to look into this problem. Though, this may take a while.

guhg commented 7 months ago

Thanks

On Fri, Oct 6, 2023, 2:14 PM Ilyasse @.***> wrote:

Alright, it seems like I’ve got enough reports to look into this problem. Though, this may take a while.

— Reply to this email directly, view it on GitHub https://github.com/Sketchware-Pro/Sketchware-Pro/issues/984#issuecomment-1751212866, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ3NVFYDKIUF66YNUGVY3UDX6BDATAVCNFSM6AAAAAA45MOJT2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJRGIYTEOBWGY . You are receiving this because you authored the thread.Message ID: @.***>

appt2 commented 7 months ago

I have also tested the same problem on several different mobiles, Poco x5& Poco F5 and Samsung s22

ilyassesalama commented 7 months ago

After a few tests, I also faced the same problem in the redesigned version on my Redmi Note 10 Pro (Android 13 - Pixel ROM). However, I tried to track the issue but couldn't find what causes it.

I think that this problem is caused by a memory leak since the app works fine at first then gradually becomes worse.

appt2 commented 7 months ago

After a few tests, I also faced the same problem in the redesigned version on my Redmi Note 10 Pro (Android 13 - Pixel ROM). However, I tried to track the issue but couldn't find what causes it.

I think that this problem is caused by a memory leak since the app works fine at first then gradually becomes worse.

Can you implement the operation in a new thread?

devkumar00001 commented 7 months ago

After a few tests, I also faced the same problem in the redesigned version on my Redmi Note 10 Pro (Android 13 - Pixel ROM). However, I tried to track the issue but couldn't find what causes it.

I think that this problem is caused by a memory leak since the app works fine at first then gradually becomes worse.

Do heavy tasks in a saparate threads not in UI main thread.

For example: Loading project

Load project list in ArrayList - Can be done in a non ui Thread Show progress of loading project - UI Thread Show project when list ready - UI thread

Only doing UI related task in main thread and rest of all that can be done in background progress put it in background task and show progress bar instead of directly loading through main thread.

This can prevent lagging imo.

But I am just saying but implementation will get pain

JavkhlanK commented 7 months ago

instead of speculating, have a look at the code, that's already the case

ilyassesalama commented 7 months ago

You all are giving me obvious ways to handle heavy threads, and I already know how to do that. As Jbk0 said, have a look at the code to understand what’s going on.

This issue will take time to resolve since the project is quite big and complicated. Help is really needed in this case.

Ohyeah66h commented 7 months ago

I have returned from conducting a thorough performance analysis on the following devices: Galaxy S22, Tab A7, Galaxy Note 7, Pixel 6A, and the Motorola Razer+. I have observed that all of these devices exhibit performance degradation in the material redesign branch. Some other snapshots also show signs of reduced performance, but to a lesser extent. I have compared these results with the latest Sketchware Pro beta release, which performed flawlessly. The Pixel 6A device seemed to suffer the most from the lag issue. This is a serious problem that requires immediate attention, as it affects the speed and responsiveness of the application, especially in the material redesign branch. The possible causes of this issue could include a memory leak or other inefficiencies in the code.

guhg commented 7 months ago

Yes, Sketchware should obviously not perform that bad. ESPECIALLY if it's on a pretty high end device and in my case, mine is pretty good and I was having very bad lag and terrible issues. My snapdragon 8 gen 1 device was performing that bad so it should be even worse for lower end devices. Crazy. But was must get to the bottom of this and not just discuss about the issue. Let's get to the root of the problem.

devkumar00001 commented 7 months ago

If memory leaks then LeakCanary.

appt2 commented 7 months ago

@ilyassesalama can you send Link class?

ilyassesalama commented 7 months ago

@ilyassesalama can you send Link class?

What class? Also, better to continue this discussion on our Discord server if you're willing to contribute.

appt2 commented 7 months ago

@ilyassesalama can you send Link class?

What class? Also, better to continue this discussion on our Discord server if you're willing to contribute.

I got kicked out of the discord server because some idiot thinks I'm a ninja coder, it's the result of delusions of taking drugs and comparing me to others.

ilyassesalama commented 7 months ago

Kindly keep this discussion respectful. You could've explained what's going on and asked to unban you instead of saying that.

guhg commented 7 months ago

True

On Wed, Oct 11, 2023, 1:12 PM Ilyasse @.***> wrote:

Kindly keep this discussion respectful. You could've explained what's going on and asked to unban you instead of saying that.

— Reply to this email directly, view it on GitHub https://github.com/Sketchware-Pro/Sketchware-Pro/issues/984#issuecomment-1758136570, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ3NVFZGX53WTIO6QOGJYP3X63HPVANCNFSM6AAAAAA45MOJTY . You are receiving this because you authored the thread.Message ID: @.***>

LasagnaGG commented 7 months ago

Same issue here. My galaxy a12 performing bad performance with the sketchware pro (latest snapshot)

Another thing even only some few blocks (oncreate) it will make the app unusable or unresponsive..

ilyassesalama commented 7 months ago

Why is it closed

It is not closed. Jbk0 linked another issue with this one to prevent duplicated issues.

guhg commented 2 months ago

Any developments on finding out what the problem is causing the bad performance?

ilyassesalama commented 2 months ago

Any developments on finding out what the problem is causing the bad performance?

Nothing yet, it is unknown where the lag is coming from. We need more contributors to investigate the issue.

Ohyeah66h commented 2 months ago

Man.

On Mon, Feb 26, 2024, 9:39 AM Ilyasse @.***> wrote:

Any developments on finding out what the problem is causing the bad performance?

Nothing yet, it is unknown where the lag is coming from. We need more contributors to investigate the issue.

— Reply to this email directly, view it on GitHub https://github.com/Sketchware-Pro/Sketchware-Pro/issues/984#issuecomment-1964302336, or unsubscribe https://github.com/notifications/unsubscribe-auth/BCVLEZHP7MKSHEPI22ZJJX3YVSNBBAVCNFSM6AAAAAA45MOJT2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRUGMYDEMZTGY . You are receiving this because you commented.Message ID: @.***>

guhg commented 4 weeks ago

I ran a high work load test and it seems that Sketchware Pro indeed has either a memory leak or high intensity impact on the CPU.

ilyassesalama commented 4 weeks ago

On my side, I can only pin this issue to make it more noticeable since it's a bit serious, hoping someone notices and tries to fix it, as this problem requires a lot of investigation and time, neither of which the current modders have at the moment.