Comments (3)
No need to mess with IPC endpoints, this issue is easily fixable:
diff --git a/Userland/Services/RequestServer/GeminiProtocol.cpp b/Userland/Services/RequestServer/GeminiProtocol.cpp
index 60c36b0579..a675aa9f79 100644
--- a/Userland/Services/RequestServer/GeminiProtocol.cpp
+++ b/Userland/Services/RequestServer/GeminiProtocol.cpp
@@ -31,7 +31,9 @@ OwnPtr<Request> GeminiProtocol::start_request(ConnectionFromClient& client, Byte
auto protocol_request = GeminiRequest::create_with_job({}, client, *job, move(output_stream));
protocol_request->set_request_fd(pipe_result.value().read_fd);
- ConnectionCache::get_or_create_connection(ConnectionCache::g_tls_connection_cache, url, job, proxy_data);
+ Core::EventLoop::current().deferred_invoke([=] {
+ ConnectionCache::get_or_create_connection(ConnectionCache::g_tls_connection_cache, url, job, proxy_data);
+ });
return protocol_request;
}
diff --git a/Userland/Services/RequestServer/HttpCommon.h b/Userland/Services/RequestServer/HttpCommon.h
index a3885ff85b..3e6070c348 100644
--- a/Userland/Services/RequestServer/HttpCommon.h
+++ b/Userland/Services/RequestServer/HttpCommon.h
@@ -102,10 +102,12 @@ OwnPtr<Request> start_request(TBadgedProtocol&& protocol, ConnectionFromClient&
auto protocol_request = TRequest::create_with_job(forward<TBadgedProtocol>(protocol), client, (TJob&)*job, move(output_stream));
protocol_request->set_request_fd(pipe_result.value().read_fd);
- if constexpr (IsSame<typename TBadgedProtocol::Type, HttpsProtocol>)
- ConnectionCache::get_or_create_connection(ConnectionCache::g_tls_connection_cache, url, job, proxy_data);
- else
- ConnectionCache::get_or_create_connection(ConnectionCache::g_tcp_connection_cache, url, job, proxy_data);
+ Core::EventLoop::current().deferred_invoke([=] {
+ if constexpr (IsSame<typename TBadgedProtocol::Type, HttpsProtocol>)
+ ConnectionCache::get_or_create_connection(ConnectionCache::g_tls_connection_cache, url, job, proxy_data);
+ else
+ ConnectionCache::get_or_create_connection(ConnectionCache::g_tcp_connection_cache, url, job, proxy_data);
+ });
return protocol_request;
}
The connection doesn't need to start right away, though this seems to break loading that very same twinings.co.uk (no idea why, looking into that before PR'ing)
from serenity.
Master: Average time: 85.24074ms, hits: 88/108
Async connection: Average time: 190.96297ms, hits: 71/108
No idea why the delay nearly doubles, but despite that, page load time goes down by ~18% (47s -> 38s)
from serenity.
37s with the RS IPC endpoints fully async, but the time spent connecting has also gone way down, plus almost all connections are now cached:
Average time: 0.018518519ms, hits: 107/108
from serenity.
Related Issues (20)
- Ladybird: WebContent crash when using Poiret One font HOT 2
- LibWeb: Discord crashes inside web worker right after login HOT 1
- Mssing IPv6 library in netinet HOT 1
- LibWeb: Cookie access is way too slow HOT 3
- LibC: Implement new library features from C23
- Ladybird: focus events are not fired when focus is moved via keyboard navigation
- AK: BufferedStreams can drop end of lines on the floor when user buffer is too small
- liblagom-ak: must be linked with -lexecinfo on FreeBSD to access backtrace(), backtrace_symbols() HOT 1
- AK: `AK::Detail::VisitImpl::has_explicitly_named_overload` causes ICE in clang assertions build HOT 3
- LibWeb: Crash on CSS animation with background-position
- LibWeb: `vertical-align: middle` for `<img>`
- ladybird on NetBSD HOT 28
- Ladybird: missing 'start', 'end', 'match-parent' and 'justify-all' values for text-align property HOT 1
- Ladybird: URL with %23 in it won't load HOT 1
- Terminal: Tab completion causes a crash after the Ctrl+C interrupt
- Linux 32bit build ABI error HOT 1
- LibWeb: Regression displaying legaliser.dk with GPU painting enabled HOT 1
- LibGUI: Windows marked as non-resizable, can be switched to full screen mode
- LibWeb: Unnecessarily loading fallback favicon for SVG documents HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serenity.