summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorrtenneti <rtenneti@chromium.org>2015-08-27 10:44:20 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-27 17:45:18 +0000
commit33851bcf29f8f880f49f255b1ffc3632b0a9182f (patch)
treeff14952d5f1f3ba4d013b077733d279cd61874b4 /net
parent98d3697792d419a65d64171de714b60f98317898 (diff)
downloadchromium_src-33851bcf29f8f880f49f255b1ffc3632b0a9182f.zip
chromium_src-33851bcf29f8f880f49f255b1ffc3632b0a9182f.tar.gz
chromium_src-33851bcf29f8f880f49f255b1ffc3632b0a9182f.tar.bz2
relnote: Cache-align the buffer used in QuicFramer::ProcessPacket's
on-stack fast path. The optimized crypto algorithms operate best on aligned memory; saves about 1.6% wall time and 2.4% CPU time in QUIC. Merge internal change: 101040440 R=rch@chromium.org Review URL: https://codereview.chromium.org/1315163005 Cr-Commit-Position: refs/heads/master@{#345915}
Diffstat (limited to 'net')
-rw-r--r--net/quic/quic_framer.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/quic/quic_framer.cc b/net/quic/quic_framer.cc
index 57a4f6c..27dd39d 100644
--- a/net/quic/quic_framer.cc
+++ b/net/quic/quic_framer.cc
@@ -7,6 +7,7 @@
#include <stdint.h>
#include "base/basictypes.h"
+#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/stl_util.h"
#include "net/quic/crypto/crypto_framer.h"
@@ -550,7 +551,12 @@ bool QuicFramer::ProcessPacket(const QuicEncryptedPacket& packet) {
} else if (public_header.reset_flag) {
rv = ProcessPublicResetPacket(&reader, public_header);
} else if (packet.length() <= kMaxPacketSize) {
- char buffer[kMaxPacketSize];
+ // The optimized decryption algorithm implementations run faster when
+ // operating on aligned memory.
+ //
+ // TODO(rtenneti): Change the default 64 alignas value (used the default
+ // value from CACHELINE_SIZE).
+ ALIGNAS(64) char buffer[kMaxPacketSize];
rv = ProcessDataPacket(&reader, public_header, packet, buffer,
kMaxPacketSize);
} else {