PM 32.5.2: Twitter's embedding code is slow.

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 940
Joined: 2021-01-26, 11:18

PM 32.5.2: Twitter's embedding code is slow.

Unread post by Kris_88 » 2023-12-28, 15:17

The problem related to Twitter was discussed in the topic: viewtopic.php?f=70&t=30699

What can I say...
1) It is more convenient to explore the direct link.

Code: Select all

https://syndication.twitter.com/srv/timeline-profile/screen-name/michaeljackson?dnt=false&frame=false&hideBorder=false&hideFooter=false&hideHeader=false&hideScrollBar=false&lang=en&showHeader=true&showReplies=false&theme=dark&transparent=false
2) In Firefox, a radical difference in loading speed is observed when moving from version 60.0 to version 61.0
https://ftp.mozilla.org/pub/firefox/rel ... n64/en-US/
https://ftp.mozilla.org/pub/firefox/rel ... n64/en-US/

3) I used a launcher that disables e10s and runs Firefox in "portable" mode. Just extract "Firefox Setup xxx.exe" using 7-zip and place the batch file near the "core" folder.

Code: Select all

@echo off
set PGM_CORE=Core
set PGM_NAME=Firefox
rem set PGM_HOME_URL=

set ABS_PATH=%~dp0
set PGM_EXE=%ABS_PATH%%PGM_CORE%\%PGM_NAME%.exe
set USER_PROF=%ABS_PATH%%USERNAME%
set DNLDS_DIR=%ABS_PATH%Downloads
set MOZILLA_PLUGINS=%ABS_PATH%Plugins
set JAVA_PLUGINS=%ABS_PATH%Plugins\Java

IF NOT EXIST "%PGM_EXE%" EXIT

IF EXIST "%ABS_PATH%%PGM_CORE%\updater.exe" ren "%ABS_PATH%%PGM_CORE%\updater.exe" "updater.exe.old"
IF EXIST "%ABS_PATH%%PGM_CORE%\updater.ini" ren "%ABS_PATH%%PGM_CORE%\updater.ini" "updater.ini.old"

IF NOT EXIST "%USER_PROF%" md "%USER_PROF%"
IF NOT EXIST "%DNLDS_DIR%" md "%DNLDS_DIR%"
IF NOT EXIST "%MOZILLA_PLUGINS%" md "%MOZILLA_PLUGINS%"
IF NOT EXIST "%JAVA_PLUGINS%" md "%JAVA_PLUGINS%"

set USER_JS=%USER_PROF%\user.js
echo user_pref("browser.cache.disk.enable", false); >"%USER_JS%"
echo user_pref("plugin.expose_full_path", true); >>"%USER_JS%"
echo user_pref("extensions.enabledScopes", 5); >>"%USER_JS%"
echo user_pref("browser.download.useDownloadDir", false); >>"%USER_JS%"
echo user_pref("browser.download.manager.retention", 1); >>"%USER_JS%"
echo user_pref("browser.shell.checkDefaultBrowser", false); >>"%USER_JS%"
echo user_pref("browser.taskbar.lists.enabled", false); >>"%USER_JS%"
echo user_pref("app.update.auto", false); >>"%USER_JS%"
echo user_pref("app.update.enabled", false); >>"%USER_JS%"
echo user_pref("browser.cache.disk.parent_directory", "%USER_PROF:\=\\%"); >>"%USER_JS%"
echo user_pref("browser.download.lastDir", "%DNLDS_DIR:\=\\%"); >>"%USER_JS%"
IF DEFINED PGM_HOME_URL echo user_pref("browser.startup.homepage", "%PGM_HOME_URL%"); >>"%USER_JS%"

echo user_pref("browser.tabs.remote.autostart", false); >>"%USER_JS%"
echo user_pref("browser.tabs.remote.force-enable", false); >>"%USER_JS%"
echo user_pref("dom.ipc.processCount", 1); >>"%USER_JS%"

echo user_pref("devtools.chrome.enabled", true); >>"%USER_JS%"
echo user_pref("devtools.debugger.remote-enabled", true); >>"%USER_JS%"
echo user_pref("dom.always_stop_slow_scripts", true); >>"%USER_JS%"
echo user_pref("dom.max_script_run_time", 20); >>"%USER_JS%"

set XRE_PROFILE_LOCAL_PATH=%USER_PROF%
set XRE_PROFILE_PATH=%USER_PROF%

set MOZ_FORCE_DISABLE_E10S=1

set MOZ_NO_REMOTE=1
set MOZ_PLUGIN_PATH=%MOZILLA_PLUGINS%;%JAVA_PLUGINS%
start "%PGM_NAME% Portable" "%PGM_EXE%" -–disable-e10s
4) What is the cause of the problem - I don’t know yet. But I have some guesses.
It is possible that the images are loading and resizing slowly. Maybe the reason is SVG without dimensions. Also, maybe when the page is loaded, some unnecessary events are generated, the processing of which takes a lot of time. Maybe it's extra "load" events or something related to ResizeObserver.

User avatar
Kand_in_Sky
Fanatic
Fanatic
Posts: 130
Joined: 2013-01-02, 18:22
Location: DE

Re: PM 32.5.2: Twitter's embedding code is slow.

Unread post by Kand_in_Sky » 2023-12-28, 17:49

One possible help is the add-on OldTwitter Layout, for Chromium and FireFox
https://github.com/dimdenGD/OldTwitter
https://addons.mozilla.org/firefox/addo ... yout-2022/

X/Twitter is a JS hell, this addon speed it up a little bit, the perfect X/Twitter would be like Nitter ;-)

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 940
Joined: 2021-01-26, 11:18

Re: PM 32.5.2: Twitter's embedding code is slow.

Unread post by Kris_88 » 2023-12-28, 23:13

Kand_in_Sky wrote:
2023-12-28, 17:49
One possible help is the add-on OldTwitter Layout, for Chromium and FireFox
This is really interesting. Thank you!

However, the goal is different - to figure out why it works so slowly in the Pale Moon. The initial loading of scripts turns out to be slow in any browser (although there are questions here). Also, resizing a page after loading is a time-consuming operation in any browser. However, loading posts from the feed is very different and is clearly something that is browser specific and could be improved.