ベンチマークテストで使用したプログラムの作成方法とコード一覧  原作者 古口正巳 [koguchi@sf.airnet.ne.jp] 1998.7.26更新  参考にして自由に改変再配布してもらってけっこうですが,あらゆる条件で正しく動作することを保証してません。 できるだけ同じHTML文を出力するように各種プログラムを作成した。 また全文の同時出力と一行ずつ出力したときの違いについても検討した。 1.htmファイルの作成 エディッタ使用 Welcome to GeroGero's Softs square!

Welcome to GeroGero's Softs square!

2.ASPファイルの作成(全文出力) エディッタ使用 <% Dim strOut Send "" Send "Welcome to GeroGero's Softs square!" Send "" Send "

Welcome to GeroGero's Softs square!

" Send "" Send "" 'これからは変更しないで下さい Response.Write strOut %> 3.ASPファイルの作成(行毎出力) エディッタ使用 <% Dim strOut 'Response.buffer = True Send "" Send "Welcome to GeroGero's Softs square!" Send "" Send "

Welcome to GeroGero's Softs square!

" Send "" Send "" 'Response.End 'Flush %> 4.ASPファイルの作成(Active X DLL 全文出力) エディッタ使用 VB5.0でのActive X DLLの作成とトランザクションサーバーへの登録 <% Set strOut= Server.CreateObject("Gero2Project.Gero2Class") Response.Write strOut.CgiOut %> 以下VB5.0によるクラスの作成(Gero2Project.Gero2Class) クラスモジュール使用 Option Explicit Public strOut As String Function cgiOut() As String Send "" Send "Welcome to GeroGero's Softs square!" Send "" Send "

Welcome to GeroGero's Softs square!

" Send "" Send "" 'これからは変更しないで下さい cgiOut = strOut End Function Sub Send(s As String) '日本語非対応 標準出力からテキストを出力 strOut = strOut & s & vbCrLf End Sub 5.VB CGIファイルの作成(全文出力) 標準モジュール使用 ' '原作者 古口正巳  ' 'STDOUTを用いたVB(32bit)CGI TEST 1998.07.24 ' Option Explicit Declare Function GetStdHandle Lib "kernel32" _ (ByVal nStdHandle As Long) As Long Declare Function WriteFile Lib "kernel32" _ (ByVal hFile As Long, _ ByVal lpBuffer As String, _ ByVal nNumberOfBytesToWrite As Long, _ lpNumberOfBytesWritten As Long, _ lpOverlapped As Any) As Long Public Const STD_OUTPUT_HANDLE = -11& Public hStdOut As Long ' 標準出力ハンドル Public strOut As String Sub Main() hStdOut = GetStdHandle(STD_OUTPUT_HANDLE) '標準出力ハンドルの取得 'ここからプログラムを書きます。 Send "Status: 200 OK" Send "Content-type: text/html" & vbCrLf Send "" Send "Welcome to GeroGero's Softs square!" Send "" Send "

Welcome to GeroGero's Softs square!

" Send "" Send "" 'これからは変更しないで下さい sendAll End Sub Sub Send(s As String) '日本語非対応 標準出力からテキストを出力 strOut = strOut & s & vbCrLf End Sub Sub sendAll() 'バッファーの内容を出力する Dim rc As Long Dim lBytesWritten As Long rc = WriteFile(hStdOut, strOut, Len(strOut), lBytesWritten, ByVal 0&) End Sub 6.VB CGIファイルの作成(行毎出力) 標準モジュール使用 ' '原作者 古口正巳  ' 'STDOUTを用いたVB(32bit)CGI TEST 1998.07.24 ' Option Explicit Declare Function GetStdHandle Lib "kernel32" _ (ByVal nStdHandle As Long) As Long Declare Function WriteFile Lib "kernel32" _ (ByVal hFile As Long, _ ByVal lpBuffer As String, _ ByVal nNumberOfBytesToWrite As Long, _ lpNumberOfBytesWritten As Long, _ lpOverlapped As Any) As Long Public Const STD_OUTPUT_HANDLE = -11& Public hStdOut As Long ' 標準出力ハンドル Sub Main() hStdOut = GetStdHandle(STD_OUTPUT_HANDLE) '標準出力ハンドルの取得 'ここからプログラムを書きます。 Send "Status: 200 OK" Send "Content-type: text/html" & vbCrLf Send "" Send "Welcome to GeroGero's Softs square!" Send "" Send "

Welcome to GeroGero's Softs square!

" Send "" Send "" End Sub Sub Send(s As String) '日本語非対応 標準出力からテキストを出力 Dim rc As Long Dim lBytesWritten As Long s = s & vbCrLf rc = WriteFile(hStdOut, s, Len(s), lBytesWritten, ByVal 0&) End Sub 7.C++ CGIファイルの作成(行毎出力) APP WIZARD WIN32 CONSOLE APPLICATION使用 #include void main() { printf("Status: 200 OK\r\n"); printf("Content-type: text/html\r\n\r\n"); printf("\r\n"); printf("Welcome to GeroGero's Softs square!\r\n"); printf("\r\n"); printf("

Welcome to GeroGero's Softs square!

\r\n"); printf("\r\n"); printf("\r\n"); } 8.C++ CGIファイルの作成(行毎出力) APP WIZARD ISAPI EXTENSION使用 void CGeroISAPIExtension::Default(CHttpServerContext* pCtxt) { *pCtxt << _T("\r\n"); *pCtxt << _T("Welcome to GeroGero's Softs square!\r\n"); *pCtxt << _T("\r\n"); *pCtxt << _T("

Welcome to GeroGero's Softs square!

\r\n"); *pCtxt << _T("\r\n"); *pCtxt << _T("\r\n"); } 9.PerlIS(LINE)ファイルの作成 エディッタ使用 printf("Content-type: text/html\r\n\r\n"); printf("\r\n"); printf("Welcome to GeroGero's Softs square!\r\n"); printf("\r\n"); printf("

Welcome to GeroGero's Softs square!

\r\n"); printf("\r\n"); printf("\r\n");