@article{oai:ipsj.ixsq.nii.ac.jp:00238215,
 author = {川向, 聡 and 山崎, 徹郎 and 千葉, 滋 and Satoshi, Kawamukai and Tetsuro, Yamazaki and Shigeru, Chiba},
 issue = {4},
 journal = {情報処理学会論文誌プログラミング(PRO)},
 month = {Aug},
 note = {この論文では保守的に,非同期的かもしれない関数呼び出しにawaitを書くことでawait忘れを防ぐという方針について考える.JavaScriptのasync/await構文は非同期計算を記述するために便利であるが,しばしばawaitを書き忘れることが難しいバグの原因となる.しかし保守的なawaitでは,同期的な式のawaitのために計算効率が大幅に低下してしまう.我々は不要なawaitによるオーバーヘッドを削減するため,potentially-async関数を提案する.Potentially-async関数ではawait式は,オペランドが同期的か非同期的かを実行時に判断することで不要なawaitによるオーバーヘッドを削減できる.我々は実験によって不要なawaitが多いプログラムであれば実行時間を最大で90%程度削減できること,必要なawaitが多いプログラムでは最大で73%のオーバーヘッドが生じることを確認した.Potentially-async関数はプログラム変換によってJavaScriptプログラムに変換してから実行できるため,ブラウザ上でも実行することができる., In this paper, we consider about an approach that conservatively writes awaits for potentially asynchronous function calls. Although async/await notation in JavaScript is useful to describe asynchronous computations, missing awaits often cause difficult bugs. However, conservatively awaiting significantly reduces execution speed due to awaiting for synchronous expressions. For reducing overheads due to unnecessary awaits, we propose potentially-async function. Potentially-async function can reduce the overhead due to unnecessary awaits because an await-expression changes its behavior depending on whether the operand is synchronous or asynchronous. Our experimental result shows that potentially-async function reduces execution time of programs with many unnecessary awaits by 90% at most, and it also causes another overhead that increases execution time of programs with many necessary awaits by 73% at most. We also provide a program transformation from potentially-async function declaration to async or non-async function declaration, thus one can execute potentially-async functions on their browsers.},
 pages = {10--20},
 title = {保守的なawaitのために同期的か非同期的かを実行時に切り替えるpotentially-async関数},
 volume = {17},
 year = {2024}
}