Automatic migration from synchronous to asynchronous JavaScript APIs

The JavaScript ecosystem provides equivalent synchronous and asynchronous Application Programming Interfaces (APIs) for many commonly used I/O operations. Synchronous APIs involve straightforward sequential control flow that makes them easy to use and understand, but their "blocking" behav...

Celý popis

Uloženo v:
Podrobná bibliografie
Vydáno v:Proceedings of ACM on programming languages Ročník 5; číslo OOPSLA; s. 1 - 27
Hlavní autoři: Gokhale, Satyajit, Turcotte, Alexi, Tip, Frank
Médium: Journal Article
Jazyk:angličtina
Vydáno: 01.10.2021
ISSN:2475-1421, 2475-1421
On-line přístup:Získat plný text
Tagy: Přidat tag
Žádné tagy, Buďte první, kdo vytvoří štítek k tomuto záznamu!
Abstract The JavaScript ecosystem provides equivalent synchronous and asynchronous Application Programming Interfaces (APIs) for many commonly used I/O operations. Synchronous APIs involve straightforward sequential control flow that makes them easy to use and understand, but their "blocking" behavior may result in poor responsiveness or performance. Asynchronous APIs impose a higher syntactic burden that relies on callbacks, promises, and higher-order functions. On the other hand, their nonblocking behavior enables applications to scale better and remain responsive while I/O requests are being processed. While it is generally understood that asynchronous APIs have better performance characteristics, many applications still rely on synchronous APIs. In this paper, we present a refactoring technique for assisting programmers with the migration from synchronous to asynchronous APIs. The technique relies on static analysis to determine where calls to synchronous API functions can be replaced with their asynchronous counterparts, relying on JavaScript's async/await feature to minimize disruption to the source code. Since the static analysis is potentially unsound, the proposed refactorings are presented as suggestions that must be reviewed and confirmed by the programmer. The technique was implemented in a tool named Desynchronizer. In an empirical evaluation on 12 subject applications containing 316 synchronous API calls, Desynchronizer identified 256 of these as candidates for refactoring. Of these candidates, 244 were transformed successfully, and only 12 resulted in behavioral changes. Further inspection of these cases revealed that the majority of these issues can be attributed to unsoundness in the call graph.
AbstractList The JavaScript ecosystem provides equivalent synchronous and asynchronous Application Programming Interfaces (APIs) for many commonly used I/O operations. Synchronous APIs involve straightforward sequential control flow that makes them easy to use and understand, but their "blocking" behavior may result in poor responsiveness or performance. Asynchronous APIs impose a higher syntactic burden that relies on callbacks, promises, and higher-order functions. On the other hand, their nonblocking behavior enables applications to scale better and remain responsive while I/O requests are being processed. While it is generally understood that asynchronous APIs have better performance characteristics, many applications still rely on synchronous APIs. In this paper, we present a refactoring technique for assisting programmers with the migration from synchronous to asynchronous APIs. The technique relies on static analysis to determine where calls to synchronous API functions can be replaced with their asynchronous counterparts, relying on JavaScript's async/await feature to minimize disruption to the source code. Since the static analysis is potentially unsound, the proposed refactorings are presented as suggestions that must be reviewed and confirmed by the programmer. The technique was implemented in a tool named Desynchronizer. In an empirical evaluation on 12 subject applications containing 316 synchronous API calls, Desynchronizer identified 256 of these as candidates for refactoring. Of these candidates, 244 were transformed successfully, and only 12 resulted in behavioral changes. Further inspection of these cases revealed that the majority of these issues can be attributed to unsoundness in the call graph.
Author Tip, Frank
Gokhale, Satyajit
Turcotte, Alexi
Author_xml – sequence: 1
  givenname: Satyajit
  surname: Gokhale
  fullname: Gokhale, Satyajit
  organization: Northeastern University, USA
– sequence: 2
  givenname: Alexi
  surname: Turcotte
  fullname: Turcotte, Alexi
  organization: Northeastern University, USA
– sequence: 3
  givenname: Frank
  surname: Tip
  fullname: Tip, Frank
  organization: Northeastern University, USA
BookMark eNplkE1LAzEYhINUsNbiX8jN02qySTbJcalflYKCvS_vZhONdDclSYX-e1ftoehpZuBhGOYcTYYwWIQuKbmmlIsbxpUQTJ6gacmlKCgv6eTIn6F5Sh-EEKpHkukpuq13OfSQvcG9f4ujCQN2MfQ47QfzHsMQdgnngOE4P8EnvJrotxnXL8t0gU4dbJKdH3SG1vd368VjsXp-WC7qVWFKoXJhdFcJaPW4kDnCwDgleVVWomUdSNlxYZ1yApStpNCGdKIFI1VpuKtAazZDxW-tiSGlaF1jfP5ZnCP4TUNJ831Cczhh5K_-8Nvoe4j7f-QXmoddmQ
CitedBy_id crossref_primary_10_1145_3656429
crossref_primary_10_1007_s10009_025_00781_6
crossref_primary_10_1007_s10664_025_10663_9
crossref_primary_10_1016_j_jpdc_2025_105130
crossref_primary_10_3390_fi15090306
crossref_primary_10_3390_fi16110416
crossref_primary_10_3390_app14198866
Cites_doi 10.5555/2486788.2486887
10.1007/978-3-662-44202-9_21
10.1109/ASE.2015.50
10.1109/ICSME.2017.83
10.1145/1639950.1640018
10.5555/1883978.1883994
10.4230/LIPIcs.ECOOP.2016.2
10.1145/2858965.2814272
10.1145/1985793.1985804
10.1145/1595696.1595723
10.1109/ICSE.2019.00072
10.1109/ICSE.2009.5070539
10.1145/3133910
10.1145/2635868.2635903
10.1145/2568225.2568309
ContentType Journal Article
DBID AAYXX
CITATION
DOI 10.1145/3485537
DatabaseName CrossRef
DatabaseTitle CrossRef
DatabaseTitleList CrossRef
DeliveryMethod fulltext_linktorsrc
Discipline Computer Science
EISSN 2475-1421
EndPage 27
ExternalDocumentID 10_1145_3485537
GroupedDBID AAKMM
AAYFX
AAYXX
ACM
AEFXT
AEJOY
AIKLT
AKRVB
ALMA_UNASSIGNED_HOLDINGS
CITATION
GUFHI
LHSKQ
M~E
OK1
ROL
ID FETCH-LOGICAL-c258t-c9d65ab95533f03acf8746265b3da77d45ef8f5a8e6759c0d5bac782c4f6a993
ISICitedReferencesCount 15
ISICitedReferencesURI http://www.webofscience.com/api/gateway?GWVersion=2&SrcApp=Summon&SrcAuth=ProQuest&DestLinkType=CitingArticles&DestApp=WOS_CPL&KeyUT=000731569200062&url=https%3A%2F%2Fcvtisr.summon.serialssolutions.com%2F%23%21%2Fsearch%3Fho%3Df%26include.ft.matches%3Dt%26l%3Dnull%26q%3D
ISSN 2475-1421
IngestDate Sat Nov 29 07:51:23 EST 2025
Tue Nov 18 22:04:26 EST 2025
IsDoiOpenAccess false
IsOpenAccess true
IsPeerReviewed true
IsScholarly true
Issue OOPSLA
Language English
LinkModel OpenURL
MergedId FETCHMERGED-LOGICAL-c258t-c9d65ab95533f03acf8746265b3da77d45ef8f5a8e6759c0d5bac782c4f6a993
OpenAccessLink https://dl.acm.org/doi/pdf/10.1145/3485537
PageCount 27
ParticipantIDs crossref_citationtrail_10_1145_3485537
crossref_primary_10_1145_3485537
PublicationCentury 2000
PublicationDate 2021-10-01
PublicationDateYYYYMMDD 2021-10-01
PublicationDate_xml – month: 10
  year: 2021
  text: 2021-10-01
  day: 01
PublicationDecade 2020
PublicationTitle Proceedings of ACM on programming languages
PublicationYear 2021
References e_1_2_2_4_1
e_1_2_2_14_1
e_1_2_2_5_1
e_1_2_2_13_1
e_1_2_2_12_1
e_1_2_2_7_1
e_1_2_2_11_1
e_1_2_2_22_1
e_1_2_2_10_1
e_1_2_2_21_1
e_1_2_2_1_1
e_1_2_2_20_1
e_1_2_2_2_1
e_1_2_2_3_1
Babel Parser Documentation JS. (e_1_2_2_6_1); 202
e_1_2_2_19_1
e_1_2_2_9_1
e_1_2_2_18_1
e_1_2_2_8_1
e_1_2_2_17_1
e_1_2_2_16_1
e_1_2_2_15_1
Zhang Yang (e_1_2_2_23_1)
References_xml – ident: e_1_2_2_9_1
  doi: 10.5555/2486788.2486887
– ident: e_1_2_2_16_1
  doi: 10.1007/978-3-662-44202-9_21
– volume: 202
  start-page: 03
  ident: e_1_2_2_6_1
  publication-title: Accessed
– ident: e_1_2_2_12_1
  doi: 10.1109/ASE.2015.50
– ident: e_1_2_2_1_1
– ident: e_1_2_2_10_1
  doi: 10.1109/ICSME.2017.83
– ident: e_1_2_2_3_1
– ident: e_1_2_2_8_1
  doi: 10.1145/1639950.1640018
– ident: e_1_2_2_19_1
  doi: 10.5555/1883978.1883994
– ident: e_1_2_2_5_1
  doi: 10.4230/LIPIcs.ECOOP.2016.2
– ident: e_1_2_2_15_1
  doi: 10.1145/2858965.2814272
– ident: e_1_2_2_20_1
  doi: 10.1145/1985793.1985804
– ident: e_1_2_2_22_1
  doi: 10.1145/1595696.1595723
– ident: e_1_2_2_11_1
  doi: 10.1109/ICSE.2019.00072
– volume-title: Algorithms and Architectures for Parallel Processing
  ident: e_1_2_2_23_1
– ident: e_1_2_2_2_1
– ident: e_1_2_2_7_1
  doi: 10.1109/ICSE.2009.5070539
– ident: e_1_2_2_14_1
  doi: 10.1145/3133910
– ident: e_1_2_2_21_1
– ident: e_1_2_2_13_1
  doi: 10.1145/2635868.2635903
– ident: e_1_2_2_4_1
– ident: e_1_2_2_17_1
  doi: 10.1145/2568225.2568309
– ident: e_1_2_2_18_1
SSID ssj0001934839
Score 2.2763762
Snippet The JavaScript ecosystem provides equivalent synchronous and asynchronous Application Programming Interfaces (APIs) for many commonly used I/O operations....
SourceID crossref
SourceType Enrichment Source
Index Database
StartPage 1
Title Automatic migration from synchronous to asynchronous JavaScript APIs
Volume 5
WOSCitedRecordID wos000731569200062&url=https%3A%2F%2Fcvtisr.summon.serialssolutions.com%2F%23%21%2Fsearch%3Fho%3Df%26include.ft.matches%3Dt%26l%3Dnull%26q%3D
hasFullText 1
inHoldings 1
isFullTextHit
isPrint
journalDatabaseRights – providerCode: PRVHPJ
  databaseName: ROAD: Directory of Open Access Scholarly Resources
  customDbUrl:
  eissn: 2475-1421
  dateEnd: 99991231
  omitProxy: false
  ssIdentifier: ssj0001934839
  issn: 2475-1421
  databaseCode: M~E
  dateStart: 20170101
  isFulltext: true
  titleUrlDefault: https://road.issn.org
  providerName: ISSN International Centre
link http://cvtisr.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwtV1LT9wwELZa2kMvlLYgoFD5UPVSpbCJHcfHiEcf4rHSripuq4njQErJrnazCC78dsaJY9xtpdJDL1Hi2JGV-TIeT2a-IeS92VNwABYkWRwHTIMIMq7xwwsNuYtkKmoYb74fiZOT5OxM9q1Pd9aUExBVldzcyMl_FTW2obBN6uw_iNs9FBvwHIWORxQ7Hh8l-HRej1se1qvy3Mq3SSKZ3VbKUOGaoFe0OMG__gbXMGgUyMe0_3Xmm6x9t8Q1UR_p3rH5wWDjuq6Mp6HzeTrz_PP48sLGKQ-gvoUfpQuuGc6nhg1Cd8k1pbtRTjpD-tJ3RYQ9F9RmNVbIBA96rE15_qT_0GZVLveQdXraHxylng7teYtxyxvwu5pnhhEjMsQ2LWXMr0TaCwucCztsk7D5yA58Sp6FgkujC4_vPM-cxPtNCTo39zbb2ozdsWM9M8azR4YrZNluJGjaAuAVeaKr1-RlV6SDWp39huw7PFCHB2rwQD3503pMfTzQBzxQg4dVMjw8GO59CWzpjECFPKkDJfOYQyZxqlGxG4EqEsFw78qzKAchcsZ1kRQcEo0bRql2c56BQmNRsSIGNFnXyFI1rvQ6oSBkzHPFUc8zJsIsi4ucZUzIIgfgurdBPnQvYqQsrbypbvJztPC2Nwh1HSctk8pil82_d3lLXjwgb4ss1dO53ibP1XVdzqbvGkHeA0GUZ78
linkProvider ISSN International Centre
openUrl ctx_ver=Z39.88-2004&ctx_enc=info%3Aofi%2Fenc%3AUTF-8&rfr_id=info%3Asid%2Fsummon.serialssolutions.com&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.atitle=Automatic+migration+from+synchronous+to+asynchronous+JavaScript+APIs&rft.jtitle=Proceedings+of+ACM+on+programming+languages&rft.au=Gokhale%2C+Satyajit&rft.au=Turcotte%2C+Alexi&rft.au=Tip%2C+Frank&rft.date=2021-10-01&rft.issn=2475-1421&rft.eissn=2475-1421&rft.volume=5&rft.issue=OOPSLA&rft.spage=1&rft.epage=27&rft_id=info:doi/10.1145%2F3485537&rft.externalDBID=n%2Fa&rft.externalDocID=10_1145_3485537
thumbnail_l http://covers-cdn.summon.serialssolutions.com/index.aspx?isbn=/lc.gif&issn=2475-1421&client=summon
thumbnail_m http://covers-cdn.summon.serialssolutions.com/index.aspx?isbn=/mc.gif&issn=2475-1421&client=summon
thumbnail_s http://covers-cdn.summon.serialssolutions.com/index.aspx?isbn=/sc.gif&issn=2475-1421&client=summon