Przeglądaj źródła

LibCore: Bump the CHttpJob receive buffer size from 4KB to 64KB

4KB gets pretty mmap/munmap heavy when downloading larger files,
so bump this a bit to reduce time spent in memory allocation.

This can be improved in various ways, but I'm not sure what the
best way forward is at the moment.
Andreas Kling 5 lat temu
rodzic
commit
bcffe31d3a
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      Libraries/LibCore/CHttpJob.cpp

+ 1 - 1
Libraries/LibCore/CHttpJob.cpp

@@ -113,7 +113,7 @@ void CHttpJob::on_socket_connected()
         }
         ASSERT(m_state == State::InBody);
         ASSERT(m_socket->can_read());
-        auto payload = m_socket->receive(PAGE_SIZE);
+        auto payload = m_socket->receive(64 * KB);
         if (!payload) {
             if (m_socket->eof())
                 return finish_up();