From 73dbd82b7d8788e6844f11f83107919ce0ce172c Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 2 Oct 2011 12:10:02 +0000 Subject: Optimise fetch item selection when fetching many items from same host. svn path=/trunk/netsurf/; revision=12920 --- content/fetch.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'content/fetch.c') diff --git a/content/fetch.c b/content/fetch.c index 23650c530..3508b78cf 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -415,6 +415,7 @@ void fetch_dispatch_jobs(void) */ bool fetch_choose_and_dispatch(void) { + bool same_host; struct fetch *queueitem; queueitem = queue_ring; do { @@ -428,6 +429,15 @@ bool fetch_choose_and_dispatch(void) /* We can dispatch this item in theory */ return fetch_dispatch_job(queueitem); } + /* skip over other items with the same host */ + same_host = true; + while (same_host == true && queueitem->r_next != queue_ring) { + if (lwc_string_isequal(queueitem->host, + queueitem->r_next->host, &same_host) == + lwc_error_ok && same_host == true) { + queueitem = queueitem->r_next; + } + } queueitem = queueitem->r_next; } while (queueitem != queue_ring); return false; -- cgit v1.2.3