Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Bah, that'll never pass code review. How about this:

  #include <sys/uio.h>
  
  #define str(x) #x
  #define expand(x) str(x)
  #define y1 y\n
  #define y2 expand(y1) expand(y1)
  #define y4 y2 y2
  #define y8 y4 y4
  #define y16 y8 y8
  #define y32 y16 y16
  #define y64 y32 y32
  #define y128 y64 y64
  #define y256 y128 y128
  #define y512 y256 y256
  #define y1024 y512 y512
  #define y2048 y1024 y1024

  //2048 "y\n" s
  static char __attribute__((aligned(4096))) str[] = y2048;
  static struct iovec v[] = {
  	{str, 4096},			//adjust number of these to taste
  	{str, 4096},
  	{str, 4096},
  	{str, 4096},
  	{str, 4096},
  	{str, 4096},
  	{str, 4096},
  	{str, 4096},
  	{str, 4096},
  	{str, 4096},
  	{str, 4096},
  	{str, 4096},
  	{str, 4096},
  	{str, 4096},
  	{str, 4096},
  	{str, 4096},
  };
  
  
  int main(int argc, char** argv) {
  
  	while(1) {
  		//scatter-gather write (on linux there is basically no way for write to write an odd number of characters, except EOF, so we need not check for partial writes
  		(void)writev(1, v, sizeof(v) / sizeof(*v));
  	}
  	return 0;
  }


Both suffer from way to much binary bloat, for small performance hit we can shave off a whole 4Kb.

Is anyone going to take a stab at an enterprise edition?


Here you go.

   <?xml version="1.0" encoding="UTF-8"?>
   <xsl:stylesheet
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      version="3.0">

      <xsl:output method="text"/>
  
      <xsl:template match="/">
         <xsl:call-template name="y"/>
      </xsl:template>

      <xsl:template name="y">
         <xsl:text>y&#10;</xsl:text>
         <xsl:call-template name="y"/>
      </xsl:template>
   </xsl:stylesheet>


"Enterprise edition" would be the same thing but written in Java and require an Oracle backend.


Don't forget LDAP, SAML and SNMP support. What's the OID for 'y' again?



Could reuse type from 2.16.840.1.113883.18.347. It's an extended yes/no, to account for "flavours of null". (Not even joking...)


I just died a little inside.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: