/* products derived from this software without specific prior written */
/* permission. */
/* */
-/* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND */
-/* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE */
-/* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
-/* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS */
-/* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR */
-/* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF */
-/* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS */
-/* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) */
-/* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF */
-/* THE POSSIBILITY OF SUCH DAMAGE. */
+/* THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS */
+/* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */
+/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
+/* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY */
+/* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL */
+/* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS */
+/* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
+/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, */
+/* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */
+/* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
+/* POSSIBILITY OF SUCH DAMAGE. */
+/* */
+/* Copyright (c) 2006-2008 the Authors */
+/* see AUTHORS and source files for details */
/******************************************************************************/
/*
return EXIT_FAILURE;
}
- static const char *format = "${sender} ${recipient} and ${client_name}[${client_address}] at ${protocol_state}";
-
- time_t now = time(0);
-
- char str[BUFSIZ];
- static const int iterations = 10000000;
- for (int i = 0 ; i < iterations ; ++i) {
- query_format(str, BUFSIZ, format, &q);
+ static const int iterations = 50000000;
+ {
+ static const char *format = "${sender} ${recipient} and ${client_name}[${client_address}] at ${protocol_state}";
+ time_t now = time(0);
+ char str[BUFSIZ];
+ for (int i = 0 ; i < iterations ; ++i) {
+ query_format(str, BUFSIZ, format, &q);
+ }
+ time_t ellapsed = time(0) - now;
+ printf("Done %d iterations in %us (%d format per second)\n", iterations,
+ (uint32_t)ellapsed, (int)(iterations / ellapsed));
}
- time_t ellapsed = time(0) - now;
- printf("Done %d iterations in %us (%d format per second)\n", iterations,
- (uint32_t)ellapsed, (int)(iterations / ellapsed));
+ {
+ time_t now = time(0);
+ char str[BUFSIZ];
+ for (int i = 0 ; i < iterations ; ++i) {
+ snprintf(str, BUFSIZ, "%s %s and %s[%s] at %s",
+ q.sender.str, q.recipient.str, q.client_name.str, q.client_address.str,
+ smtp_state_names[q.state].str);
+ }
+ time_t ellapsed = time(0) - now;
+ printf("Done %d iterations in %us (%d format per second)\n", iterations,
+ (uint32_t)ellapsed, (int)(iterations / ellapsed));
+ }
return 0;
}