Skip to content

Commit 5edef40

Browse files
committed
chore(conf): add render control
1 parent 7307f04 commit 5edef40

9 files changed

+300
-5
lines changed

Cargo.lock

+142-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

benches/logs/Darwin_v10cpu_benchmark_logs.txt

+26-1
Large diffs are not rendered by default.

benches/logs/Darwin_v10cpu_benchmark_noargs_logs.txt

+24
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,27 @@ DATE: 2025-02-25 23:34:17
173173
Total Duration: 6.259639875s
174174
Average Duration: 125.172952ms
175175

176+
<http://spider.cloud> - 20 SAMPLES
177+
CHROME_PATH: headless_shell
178+
CHROME_ARGS: (6)("--remote-debugging-address=0.0.0.0,--remote-debugging-port=9223,--headless,--disable-gpu,--disable-gpu-sandbox,--use-gl=angle")
179+
MACHINE: Darwin/v10cpu
180+
DATE: 2025-02-26 05:28:37
181+
Total Duration: 2.627886125s
182+
Average Duration: 131.371589ms
183+
184+
<http://spider.cloud> - 20 SAMPLES
185+
CHROME_PATH: headless_shell
186+
CHROME_ARGS: (6)("--remote-debugging-address=0.0.0.0,--remote-debugging-port=9223,--headless,--disable-gpu,--disable-gpu-sandbox,--use-gl=angle")
187+
MACHINE: Darwin/v10cpu
188+
DATE: 2025-02-26 05:33:23
189+
Total Duration: 2.608605958s
190+
Average Duration: 130.414008ms
191+
192+
<http://spider.cloud> - 10 SAMPLES
193+
CHROME_PATH: headless_shell
194+
CHROME_ARGS: (6)("--remote-debugging-address=0.0.0.0,--remote-debugging-port=9223,--headless,--disable-gpu,--disable-gpu-sandbox,--use-gl=angle")
195+
MACHINE: Darwin/v10cpu
196+
DATE: 2025-02-26 05:34:13
197+
Total Duration: 1.338665375s
198+
Average Duration: 133.848741ms
199+

benches/logs_concurrent/Darwin_v10cpu_benchmark_logs.txt

+25
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,28 @@ DATE: 2025-02-25 23:34:09
2222
Total Duration: 4.158599583s
2323
Average Duration: 3.755785809s
2424

25+
<http://spider.cloud> - 20 SAMPLES
26+
CHROME_PATH: headless_shell
27+
CHROME_ARGS: (99)("--remote-debugging-address=0.0.0.0,--remote-debugging-port=9223,--headless,--disable-gpu,--disable-gpu-sandbox,--use-gl=angle,--no-first-run,--no-sandbox,--disable-setuid-sandbox,--no-zygote,--hide-scrollbars,--user-data-dir=~/.config/google-chrome,--allow-running-insecure-content,--autoplay-policy=user-gesture-required,--ignore-certificate-errors,--no-default-browser-check,--disable-dev-shm-usage,--disable-threaded-scrolling,--disable-cookie-encryption,--disable-demo-mode,--disable-dinosaur-easter-egg,--disable-fetching-hints-at-navigation-start,--disable-site-isolation-trials,--disable-web-security,--disable-threaded-animation,--disable-sync,--disable-print-preview,--disable-search-engine-choice-screen,--disable-partial-raster,--disable-in-process-stack-traces,--use-angle=swiftshader,--disable-low-res-tiling,--disable-speech-api,--disable-oobe-chromevox-hint-timer-for-testing,--disable-smooth-scrolling,--disable-default-apps,--disable-prompt-on-repost,--disable-domain-reliability,--enable-dom-distiller,--enable-distillability-service,--disable-component-update,--disable-background-timer-throttling,--disable-breakpad,--disable-crash-reporter,--disable-software-rasterizer,--disable-asynchronous-spellchecking,--disable-extensions,--disable-html5-camera,--noerrdialogs,--disable-popup-blocking,--disable-hang-monitor,--disable-checker-imaging,--enable-surface-synchronization,--disable-image-animation-resync,--disable-client-side-phishing-detection,--disable-component-extensions-with-background-pages,--run-all-compositor-stages-before-draw,--disable-background-networking,--disable-renderer-backgrounding,--disable-field-trial-config,--disable-back-forward-cache,--disable-backgrounding-occluded-windows,--log-level=3,--enable-logging=stderr,--font-render-hinting=none,--block-new-web-contents,--no-subproc-heap-profiling,--no-pre-read-main-dll,--disable-stack-profiler,--disable-libassistant-logfile,--crash-on-hang-threads,--restore-last-session,--ip-protection-proxy-opt-out,--unsafely-disable-devtools-self-xss-warning,--enable-features=PdfOopif,SharedArrayBuffer,NetworkService,NetworkServiceInProcess,--metrics-recording-only,--use-mock-keychain,--force-color-profile=srgb,--disable-infobars,--mute-audio,--disable-datasaver-prompt,--no-service-autorun,--password-store=basic,--export-tagged-pdf,--no-pings,--rusty-png,--disable-histogram-customizer,--window-size=800,600,--disable-vulkan-fallback-to-gl-for-testing,--disable-vulkan-surface,--disable-webrtc,--disable-oopr-debug-crash-dump,--disable-pnacl-crash-throttling,--disable-renderer-accessibility,--renderer-process-limit=50,--disable-pushstate-throttle,--disable-blink-features=AutomationControlled,--disable-ipc-flooding-protection,--disable-features=PaintHolding,HttpsUpgrades,DeferRendererTasksAfterInput,LensOverlay,ThirdPartyStoragePartitioning,IsolateSandboxedIframes,ProcessPerSiteUpToMainFrameThreshold,site-per-process,WebUIJSErrorReportingExtended,DIPS,InterestFeedContentSuggestions,PrivacySandboxSettings4,AutofillServerCommunication,CalculateNativeWinOcclusion,OptimizationHints,AudioServiceOutOfProcess,IsolateOrigins,ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate")
28+
MACHINE: Darwin/v10cpu
29+
DATE: 2025-02-26 05:28:33
30+
Total Duration: 1.189235583s
31+
Average Duration: 753.532166ms
32+
33+
<http://spider.cloud> - 20 SAMPLES
34+
CHROME_PATH: headless_shell
35+
CHROME_ARGS: (99)("--remote-debugging-address=0.0.0.0,--remote-debugging-port=9223,--headless,--disable-gpu,--disable-gpu-sandbox,--use-gl=angle,--no-first-run,--no-sandbox,--disable-setuid-sandbox,--no-zygote,--hide-scrollbars,--user-data-dir=~/.config/google-chrome,--allow-running-insecure-content,--autoplay-policy=user-gesture-required,--ignore-certificate-errors,--no-default-browser-check,--disable-dev-shm-usage,--disable-threaded-scrolling,--disable-cookie-encryption,--disable-demo-mode,--disable-dinosaur-easter-egg,--disable-fetching-hints-at-navigation-start,--disable-site-isolation-trials,--disable-web-security,--disable-threaded-animation,--disable-sync,--disable-print-preview,--disable-search-engine-choice-screen,--disable-partial-raster,--disable-in-process-stack-traces,--use-angle=swiftshader,--disable-low-res-tiling,--disable-speech-api,--disable-oobe-chromevox-hint-timer-for-testing,--disable-smooth-scrolling,--disable-default-apps,--disable-prompt-on-repost,--disable-domain-reliability,--enable-dom-distiller,--enable-distillability-service,--disable-component-update,--disable-background-timer-throttling,--disable-breakpad,--disable-crash-reporter,--disable-software-rasterizer,--disable-asynchronous-spellchecking,--disable-extensions,--disable-html5-camera,--noerrdialogs,--disable-popup-blocking,--disable-hang-monitor,--disable-checker-imaging,--enable-surface-synchronization,--disable-image-animation-resync,--disable-client-side-phishing-detection,--disable-component-extensions-with-background-pages,--run-all-compositor-stages-before-draw,--disable-background-networking,--disable-renderer-backgrounding,--disable-field-trial-config,--disable-back-forward-cache,--disable-backgrounding-occluded-windows,--log-level=3,--enable-logging=stderr,--font-render-hinting=none,--block-new-web-contents,--no-subproc-heap-profiling,--no-pre-read-main-dll,--disable-stack-profiler,--disable-libassistant-logfile,--crash-on-hang-threads,--restore-last-session,--ip-protection-proxy-opt-out,--unsafely-disable-devtools-self-xss-warning,--enable-features=PdfOopif,SharedArrayBuffer,NetworkService,NetworkServiceInProcess,--metrics-recording-only,--use-mock-keychain,--force-color-profile=srgb,--disable-infobars,--mute-audio,--disable-datasaver-prompt,--no-service-autorun,--password-store=basic,--export-tagged-pdf,--no-pings,--rusty-png,--disable-histogram-customizer,--window-size=800,600,--disable-vulkan-fallback-to-gl-for-testing,--disable-vulkan-surface,--disable-webrtc,--disable-oopr-debug-crash-dump,--disable-pnacl-crash-throttling,--disable-renderer-accessibility,--renderer-process-limit=50,--disable-pushstate-throttle,--disable-blink-features=AutomationControlled,--disable-ipc-flooding-protection,--disable-features=PaintHolding,HttpsUpgrades,DeferRendererTasksAfterInput,LensOverlay,ThirdPartyStoragePartitioning,IsolateSandboxedIframes,ProcessPerSiteUpToMainFrameThreshold,site-per-process,WebUIJSErrorReportingExtended,DIPS,InterestFeedContentSuggestions,PrivacySandboxSettings4,AutofillServerCommunication,CalculateNativeWinOcclusion,OptimizationHints,AudioServiceOutOfProcess,IsolateOrigins,ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate")
36+
MACHINE: Darwin/v10cpu
37+
DATE: 2025-02-26 05:33:19
38+
Total Duration: 1.187148708s
39+
Average Duration: 751.300475ms
40+
41+
<http://spider.cloud> - 10 SAMPLES
42+
CHROME_PATH: headless_shell
43+
CHROME_ARGS: (99)("--remote-debugging-address=0.0.0.0,--remote-debugging-port=9223,--headless,--disable-gpu,--disable-gpu-sandbox,--use-gl=angle,--no-first-run,--no-sandbox,--disable-setuid-sandbox,--no-zygote,--hide-scrollbars,--user-data-dir=~/.config/google-chrome,--allow-running-insecure-content,--autoplay-policy=user-gesture-required,--ignore-certificate-errors,--no-default-browser-check,--disable-dev-shm-usage,--disable-threaded-scrolling,--disable-cookie-encryption,--disable-demo-mode,--disable-dinosaur-easter-egg,--disable-fetching-hints-at-navigation-start,--disable-site-isolation-trials,--disable-web-security,--disable-threaded-animation,--disable-sync,--disable-print-preview,--disable-search-engine-choice-screen,--disable-partial-raster,--disable-in-process-stack-traces,--use-angle=swiftshader,--disable-low-res-tiling,--disable-speech-api,--disable-oobe-chromevox-hint-timer-for-testing,--disable-smooth-scrolling,--disable-default-apps,--disable-prompt-on-repost,--disable-domain-reliability,--enable-dom-distiller,--enable-distillability-service,--disable-component-update,--disable-background-timer-throttling,--disable-breakpad,--disable-crash-reporter,--disable-software-rasterizer,--disable-asynchronous-spellchecking,--disable-extensions,--disable-html5-camera,--noerrdialogs,--disable-popup-blocking,--disable-hang-monitor,--disable-checker-imaging,--enable-surface-synchronization,--disable-image-animation-resync,--disable-client-side-phishing-detection,--disable-component-extensions-with-background-pages,--run-all-compositor-stages-before-draw,--disable-background-networking,--disable-renderer-backgrounding,--disable-field-trial-config,--disable-back-forward-cache,--disable-backgrounding-occluded-windows,--log-level=3,--enable-logging=stderr,--font-render-hinting=none,--block-new-web-contents,--no-subproc-heap-profiling,--no-pre-read-main-dll,--disable-stack-profiler,--disable-libassistant-logfile,--crash-on-hang-threads,--restore-last-session,--ip-protection-proxy-opt-out,--unsafely-disable-devtools-self-xss-warning,--enable-features=PdfOopif,SharedArrayBuffer,NetworkService,NetworkServiceInProcess,--metrics-recording-only,--use-mock-keychain,--force-color-profile=srgb,--disable-infobars,--mute-audio,--disable-datasaver-prompt,--no-service-autorun,--password-store=basic,--export-tagged-pdf,--no-pings,--rusty-png,--disable-histogram-customizer,--window-size=800,600,--disable-vulkan-fallback-to-gl-for-testing,--disable-vulkan-surface,--disable-webrtc,--disable-oopr-debug-crash-dump,--disable-pnacl-crash-throttling,--disable-renderer-accessibility,--renderer-process-limit=50,--disable-pushstate-throttle,--disable-blink-features=AutomationControlled,--disable-ipc-flooding-protection,--disable-features=PaintHolding,HttpsUpgrades,DeferRendererTasksAfterInput,LensOverlay,ThirdPartyStoragePartitioning,IsolateSandboxedIframes,ProcessPerSiteUpToMainFrameThreshold,site-per-process,WebUIJSErrorReportingExtended,DIPS,InterestFeedContentSuggestions,PrivacySandboxSettings4,AutofillServerCommunication,CalculateNativeWinOcclusion,OptimizationHints,AudioServiceOutOfProcess,IsolateOrigins,ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate")
44+
MACHINE: Darwin/v10cpu
45+
DATE: 2025-02-26 05:34:10
46+
Total Duration: 558.842458ms
47+
Average Duration: 356.873224ms
48+
49+

benches/logs_concurrent/Darwin_v10cpu_benchmark_noargs_logs.txt

+26
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,29 @@ DATE: 2025-02-25 23:34:21
2222
Total Duration: 4.252429458s
2323
Average Duration: 3.912185341s
2424

25+
<http://spider.cloud> - 20 SAMPLES
26+
CHROME_PATH: headless_shell
27+
CHROME_ARGS: (6)("--remote-debugging-address=0.0.0.0,--remote-debugging-port=9223,--headless,--disable-gpu,--disable-gpu-sandbox,--use-gl=angle")
28+
MACHINE: Darwin/v10cpu
29+
DATE: 2025-02-26 05:28:38
30+
Total Duration: 1.195677s
31+
Average Duration: 761.019604ms
32+
33+
<http://spider.cloud> - 20 SAMPLES
34+
CHROME_PATH: headless_shell
35+
CHROME_ARGS: (6)("--remote-debugging-address=0.0.0.0,--remote-debugging-port=9223,--headless,--disable-gpu,--disable-gpu-sandbox,--use-gl=angle")
36+
MACHINE: Darwin/v10cpu
37+
DATE: 2025-02-26 05:33:24
38+
Total Duration: 1.208197125s
39+
Average Duration: 760.903531ms
40+
41+
<http://spider.cloud> - 10 SAMPLES
42+
CHROME_PATH: headless_shell
43+
CHROME_ARGS: (6)("--remote-debugging-address=0.0.0.0,--remote-debugging-port=9223,--headless,--disable-gpu,--disable-gpu-sandbox,--use-gl=angle")
44+
MACHINE: Darwin/v10cpu
45+
DATE: 2025-02-26 05:34:13
46+
Total Duration: 576.73775ms
47+
Average Duration: 368.845141ms
48+
49+
50+

headless_browser_lib/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ openssl-sys = { version = "0.9", features = ["vendored"] }
2323
cached = { version = "0", features = ["async_tokio_rt_multi_thread"]}
2424
tracing = "0.1"
2525
rand = "0.9"
26+
num_cpus = "1"
27+
sysinfo = "0.33"
2628

2729
[features]
2830
testing = []

headless_browser_lib/src/conf.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::collections::HashSet;
22
use std::sync::atomic::{AtomicBool, AtomicU64};
33

44
/// The performance arg count.
5-
pub(crate) const PERF_ARGS: usize = 97;
5+
pub(crate) const PERF_ARGS: usize = 99;
66

77
#[cfg(any(test, feature = "testing"))]
88
lazy_static::lazy_static! {
@@ -253,6 +253,8 @@ lazy_static::lazy_static! {
253253
"--disable-oopr-debug-crash-dump",
254254
"--disable-pnacl-crash-throttling",
255255
"--disable-renderer-accessibility",
256+
&crate::render_conf::RENDER_PROCESS_LIMIT,
257+
"--disable-pushstate-throttle",
256258
"--disable-blink-features=AutomationControlled",
257259
"--disable-ipc-flooding-protection", // we do not need to throttle navigation for https://github.com/spider-rs/spider/commit/9ff5bbd7a2656b8edb84b62843b72ae9d09af079#diff-75ce697faf0d37c3dff4a3a19e7524798b3cb5487f8f54beb5d04c4d48e34234R446.
258260
// --deterministic-mode 10-20% drop in perf

headless_browser_lib/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ pub mod conf;
66
mod modify;
77
/// Proxy forwarder TCP to chrome instances.
88
pub mod proxy;
9+
/// Chrome renderer configuration.
10+
mod render_conf;
911

1012
use conf::{
1113
CACHEABLE, CHROME_ADDRESS, CHROME_ARGS, CHROME_INSTANCES, CHROME_PATH, DEBUG_JSON,

0 commit comments

Comments
 (0)