<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>atsuhiro-me</author_name>
  <author_url>https://blog.hatena.ne.jp/atsuhiro-me/</author_url>
  <blog_title>みーのぺーじ</blog_title>
  <blog_url>https://pc.atsuhiro-me.net/</blog_url>
  <categories>
    <anon>Django</anon>
    <anon>Python</anon>
    <anon>ネットワーク</anon>
  </categories>
  <description>Djangoで非同期処理を実装するときに，非同期ではない関数を使用するためのアダプター関数 asgiref.sync.sync_to_async() が用意されています*1． sync_to_async()関数は，SyncToAsyncクラスを使って，スレッドプールで実行可能な非同期関数を作成する仕組みになっているようです． https://github.com/django/asgiref/blob/main/asgiref/sync.py ソースコードを眺めると，この関数を実行するために僅かながら処理量が増えそうな印象でしたが，非同期関数にすることで，それ以上にCPUを効率的に使用できるな…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpc.atsuhiro-me.net%2Fentry%2F2022%2F08%2F21%2F135646&quot; title=&quot;Djangoでsync_to_asyncの性能を測定する - みーのぺーじ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/a/atsuhiro-me/20220821/20220821132718.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-08-21 13:56:46</published>
  <title>Djangoでsync_to_asyncの性能を測定する</title>
  <type>rich</type>
  <url>https://pc.atsuhiro-me.net/entry/2022/08/21/135646</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
