title: What's the purpose of NodeJS async functions if the function doesn't use any I/O?
body: <p>Looking in the NodeJS bcrypt package (<a href="https://www.npmjs.com/package/bcrypt" rel="nofollow noreferrer">https://www.npmjs.com/package/bcrypt</a>), there appears to be pairs of functions for async/sync:</p>
  
  <ul>
  <li>genSalt/genSaltSync</li>
  <li>hash/hashSync</li>
  <li>compare/compareSync</li>
  </ul>
  
  <p>I understand the purpose of async functions in cases where the function has I/O such as disk or network access, so as not to block the event loop. But what about cases like the above, where there's no I/O, what advantage is there to using the async versions?</p>
  
  <p>What do you lose by choosing the sync versions? I'd like to do so because it makes for simpler code and I can't see any downside to this.</p>
  
  <p>In <a href="https://stackoverflow.com/a/11606391/779159">https://stackoverflow.com/a/11606391/779159</a> it says "you'd want to use the async version if possible so you're not tying up your node processing during the password hash", but wouldn't your code be tied up anyway since it's CPU that's being used by these functions rather than I/O?</p>