Why I still use phantomjs

134 views
Skip to first unread message

fabienlroy

unread,
Apr 9, 2021, 4:21:15 AM4/9/21
to phantomjs
Hello,
Here are some comparisons between firefox headless and phantomjs
Conclusion
  • firefox:
    • 8 processes
    • memory (RSS Total)  994 Mb
    • time (real) 0m6.087s
  • phantomjs:
    • 1 process
    • memory (RSS Total)  106 Mb
    • time (real) 0m3.245s
(sina_player) [royfn@sina-probe1 sina_player]$ clear;time ./sina_player.py sina_test.py
[sina-probe1][2021-04-09 09:45:01.682210] Running: "sina_test.py"
[sina-probe1][2021-04-09 09:45:01.700010] sinaSetupDefault:
[sina-probe1][2021-04-09 09:45:01.720863] tls version for "https://www.apple.com/iphone-12/" is "tlsv1.2"
[sina-probe1][2021-04-09 09:45:01.721004] Global.default = {
    "SEARCHTEXT": "iPhone 12",
}
[sina-probe1][2021-04-09 09:45:01.721092] sinaFirefoxDriver
./sina_player.py:1056: DeprecationWarning: use service_log_path instead of log_path
  Local.driver = webdriver.Firefox(firefox_profile=firefox_profile,log_path=log_path)
[sina-probe1][2021-04-09 09:45:03.883373] getUrl: "https://www.apple.com/iphone-12/", timeout: 30 
[sina-probe1][2021-04-09 09:45:05.335530] sinaWaitForTag: "title", timeout: "10"
[sina-probe1][2021-04-09 09:45:05.364216] STEP sinaWaitForTag "title" OK#Success:5
[sina-probe1][2021-04-09 09:45:05.364357] sinaSearchInHtml: "iPhone 12"
[sina-probe1][2021-04-09 09:45:05.400023] sinaSearchInHtml: "True"
[sina-probe1][2021-04-09 09:45:05.400306] STEP Page d'acceuil#Success:5
[sina-probe1][2021-04-09 09:45:06.899939] elapsed: "5.219439506530762"
[sina-probe1][2021-04-09 09:45:06.900301] Stat: pid: "273534", cmd: "geckodriver", max cpu: "6.25", average: "0.01", memory: "1.33 Mega bytes"
[sina-probe1][2021-04-09 09:45:06.900421] Stat: pid: "273537", cmd: "/usr/lib64/firefox/firefox", max cpu: "46.43", average: "8.64", memory: "300.87 Mega bytes"
[sina-probe1][2021-04-09 09:45:06.900469] Stat: pid: "273553", cmd: "/usr/lib64/firefox/firefox", max cpu: "12.5", average: "12.5", memory: "53.77 Mega bytes"
[sina-probe1][2021-04-09 09:45:06.900526] Stat: pid: "273626", cmd: "/usr/lib64/firefox/firefox", max cpu: "31.25", average: "5.86", memory: "281.76 Mega bytes"
[sina-probe1][2021-04-09 09:45:06.900568] Stat: pid: "273627", cmd: "/usr/lib64/firefox/firefox", max cpu: "0.0", average: "0.0", memory: "74.36 Mega bytes"
[sina-probe1][2021-04-09 09:45:06.900620] Stat: pid: "273653", cmd: "/usr/lib64/firefox/firefox", max cpu: "25.0", average: "0.93", memory: "120.65 Mega bytes"
[sina-probe1][2021-04-09 09:45:06.900660] Stat: pid: "273654", cmd: "/usr/lib64/firefox/firefox", max cpu: "0.0", average: "0.0", memory: "77.66 Mega bytes"
[sina-probe1][2021-04-09 09:45:06.900705] Stat: pid: "273764", cmd: "/usr/lib64/firefox/firefox", max cpu: "4.17", average: "0.02", memory: "83.59 Mega bytes"

real 0m6.087s
user 0m8.053s
sys 0m3.659s

phantomjs:
sina_player) [royfn@sina-probe1 sina_player]$ clear;time ./sina_player.py sina_test.py
[sina-probe1][2021-04-09 10:01:58.591083] Running: "sina_test.py"
[sina-probe1][2021-04-09 10:01:58.609742] sinaSetupDefault:
[sina-probe1][2021-04-09 10:01:58.629200] tls version for "https://www.apple.com/iphone-12/" is "tlsv1.2"
[sina-probe1][2021-04-09 10:01:58.629349] Global.default = {
    "SEARCHTEXT": "iPhone 12",
}
[sina-probe1][2021-04-09 10:01:58.629402] sinaPhantomJsDriver:
[sina-probe1][2021-04-09 10:01:58.629525] phantomjs OK
[sina-probe1][2021-04-09 10:01:58.645540] Warning: process "sina_port_server" not found, only "Basic Authentification" is possible 
[sina-probe1][2021-04-09 10:01:58.645640] sinaPhantomJsDriver: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/53
[sina-probe1][2021-04-09 10:01:59.696119] getUrl: "https://www.apple.com/iphone-12/", timeout: 30 
[sina-probe1][2021-04-09 10:02:01.053207] sinaWaitForTag: "title", timeout: "10"
[sina-probe1][2021-04-09 10:02:01.061885] STEP sinaWaitForTag "title" OK#Success:5
[sina-probe1][2021-04-09 10:02:01.062066] sinaSearchInHtml: "iPhone 12"
[sina-probe1][2021-04-09 10:02:01.079268] sinaSearchInHtml: "True"
[sina-probe1][2021-04-09 10:02:01.079382] STEP Page d'acceuil#Success:5
[sina-probe1][2021-04-09 10:02:01.102065] elapsed: "2.512758255004883"
[sina-probe1][2021-04-09 10:02:01.102240] Stat: pid: "274260", cmd: "phantomjs", max cpu: "25.0", average: "7.9", memory: "106.26 Mega bytes"

real 0m3.245s
user 0m2.231s
sys 0m0.866s
Reply all
Reply to author
Forward
0 new messages