[master] 7a9c412 Optimize the trivial string case.
Poul-Henning Kamp
phk at FreeBSD.org
Mon Nov 13 09:18:06 UTC 2017
commit 7a9c412898fa570a1f3d857490c48ad9f97fa7e0
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Nov 13 09:15:09 2017 +0000
Optimize the trivial string case.
diff --git a/bin/varnishd/cache/cache_shmlog.c b/bin/varnishd/cache/cache_shmlog.c
index c129fa3..cf72726 100644
--- a/bin/varnishd/cache/cache_shmlog.c
+++ b/bin/varnishd/cache/cache_shmlog.c
@@ -334,6 +334,14 @@ VSLbv(struct vsl_log *vsl, enum VSL_tag_e tag, const char *fmt, va_list ap)
return;
}
+ if (!strcmp(fmt, "%s")) {
+ p = va_arg(ap, char *);
+ t.b = p;
+ t.e = strchr(p, '\0');
+ VSLbt(vsl, tag, t);
+ return;
+ }
+
mlen = cache_param->vsl_reclen;
/* Flush if we cannot fit a full size record */
More information about the varnish-commit
mailing list