Skip to content

Instantly share code, notes, and snippets.

@oiwn
Created August 17, 2012 14:55
Show Gist options
  • Save oiwn/3379472 to your computer and use it in GitHub Desktop.
Save oiwn/3379472 to your computer and use it in GitHub Desktop.
Memory and cpu optimization for Selenium
# Memory and cpu optimization
profile.set_preference('browser.sessionhistory.max_total_viewers', 0)
#profile.set_preference('browser.cache.memory.enable', False)
#profile.set_preference('browser.cache.offline.enable', False)
#profile.set_preference('browser.cache.disk.enable', False)
profile.set_preference('browser.safebrowsing.enabled', False)
profile.set_preference('browser.shell.checkDefaultBrowser', False)
profile.set_preference('browser.startup.page', 0)
profile.set_preference('dom.ipc.plugins.enabled.timeoutSecs', 15)
profile.set_preference('dom.max_script_run_time', 10)
profile.set_preference('extensions.checkCompatibility', False)
profile.set_preference('extensions.checkUpdateSecurity', False)
profile.set_preference('extensions.update.autoUpdateEnabled', False)
profile.set_preference('extensions.update.enabled', False)
profile.set_preference('network.http.max-connections-per-server', 30)
profile.set_preference('network.prefetch-next', False)
profile.set_preference('plugin.default_plugin_disabled', False)
profile.set_preference('print.postscript.enabled', False)
profile.set_preference('toolkit.storage.synchronous', 0)
profile.set_preference('image.animation_mode', 'none')
profile.set_preference('images.dither', False)
profile.set_preference('content.notify.interval', 1000000)
profile.set_preference('content.switch.treshold', 100000)
profile.set_preference('nglayout.initialpaint.delay', 1000000)
profile.set_preference('network.dnscacheentries', 200)
profile.set_preference('network.dnscacheexpiration', 600)
@thachsinh
Copy link

thank u sir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment