{"id":334262,"date":"2022-06-09T15:00:54","date_gmt":"2022-06-09T15:00:54","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=334262"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=334262","title":{"rendered":"<span>\u0423\u0441\u043a\u043e\u0440\u044f\u0435\u043c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e JSON \u0432 Python \u0441 orjson \u0438 Rust<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b<\/h2>\n<h4>\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 JSON \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0430\u0440\u0445\u0438\u0432\u043d\u0443\u044e \u0411\u0414<\/h4>\n<p><em>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e \u044d\u0442\u043e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435&#8230;<\/em><\/p>\n<p>\u0412 \u043e\u0434\u0438\u043d \u0438\u0437 \u0442\u0435\u0445 \u043b\u0435\u0442\u043d\u0438\u0445 \u0434\u043d\u0435\u0439, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430 \u0443\u043b\u0438\u0446\u0435 \u0441\u0442\u043e\u044f\u043b\u0430 \u044f\u0441\u043d\u0430\u044f, \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u0430\u044f, \u0436\u0430\u0440\u043a\u0430\u044f \u043f\u043e\u0433\u043e\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0441\u0442\u0440\u0438\u0436\u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u043e\u043b\u0435\u0442\u0430\u043b\u0438 \u0437\u0430 \u043e\u043a\u043d\u043e\u043c, \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u044f \u0432\u0435\u0441\u0435\u043b\u044b\u0435 \u0437\u0432\u0443\u043a\u0438, \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0443 (\u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <strong>Python<\/strong>). \u0417\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438 (\u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0438 \u0442.\u0434.) \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 (JSON \u0444\u043e\u0440\u043c\u0430\u0442), \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u044d\u0442\u0438\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 JSON \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0432 \u0430\u0440\u0445\u0438\u0432\u043d\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0432 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u044e\u043d\u0438\u0442 \u0442\u0435\u0441\u0442\u044b, \u043c\u044b \u0432\u044b\u043a\u0430\u0442\u0438\u043b\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0434\u043d\u043e \u0438\u0437 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u0438 \u0441\u0442\u0430\u043b\u0438 \u0436\u0434\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432. \u041f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043e\u0442\u043c\u0435\u043d\u043d\u043e, \u043d\u043e, \u043e\u0446\u0435\u043d\u0438\u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u044f \u0437\u0430\u0434\u0430\u043b\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c, \u0430 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0435\u0433\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c?<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/dm\/ex\/r3\/dmexr35pbipugldtuisju8wtydu.jpeg\" alt=\"\" title=\"\" width=\"auto\" height=\"auto\" data-src=\"https:\/\/habrastorage.org\/webt\/dm\/ex\/r3\/dmexr35pbipugldtuisju8wtydu.jpeg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<blockquote>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u0438, \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f:\u00a0<\/p>\n<p>&#8212; \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 <strong>\u0410<\/strong> (<em>\u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0440\u043e\u0434\u0435 Oracle, MySQL, Postgres, MongoDB, \u0438\u043b\u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0438\u043b\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441<\/em>) <br \/>&#8212; \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u0438 \u043e\u0431\u043e\u0433\u0430\u0449\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 <br \/>&#8212; \u0417\u0430\u043f\u0438\u0441\u044c \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 <strong>B<\/strong> \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON <\/p>\n<\/blockquote>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0448\u043b\u043e \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u2014 \u044d\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u0421 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u0447\u0438\u0441\u043b\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u043b\u043e\u0441\u044c (\u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 N \u0440\u0430\u0437 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u043d\u043e \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0432 32 \u0440\u0430\u0437\u0430 \u0434\u043b\u044f 32 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u0442.\u043a. \u0441 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u043c \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0430 \u043f\u0430\u0434\u0430\u0442\u044c). \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435) \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u042f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432\u044b\u0437\u0432\u0430\u043d\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u044e\u0449\u0438\u043c\u0438 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u043c\u0438 \u0440\u0430\u0441\u0445\u043e\u0434\u0430\u043c\u0438 \u0434\u043b\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 (\u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 <em>MultiprocessingPool<\/em>) \u0438 \u0432\u043e\u0437\u0440\u043e\u0441\u0448\u0435\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u043d\u0430 \u0441\u0435\u0442\u044c \u0438 \u0411\u0414. \u041f\u043e\u0441\u043b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (<em>\u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0431\u044b\u043b\u043e 85 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432<\/em>) \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0432\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435.  <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/kn\/k7\/xs\/knk7xsqhnmhpacz_6c1fzkrc_9y.png\" alt=\"\" title=\"\" width=\"auto\" height=\"auto\" data-src=\"https:\/\/habrastorage.org\/webt\/kn\/k7\/xs\/knk7xsqhnmhpacz_6c1fzkrc_9y.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0418\u043d\u0442\u0443\u0438\u0446\u0438\u044f \u0448\u0435\u043f\u0442\u0430\u043b\u0430 \u043c\u043d\u0435, \u0447\u0442\u043e \u044d\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0432\u0441\u0451, \u0438 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043f\u043d\u0443\u0442\u044c \u0433\u043b\u0443\u0431\u0436\u0435 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.\u00a0<\/p>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0441 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0430 <strong>Python<\/strong>, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <a href=\"https:\/\/www.ray.io\/\"><em>ray<\/em><\/a> \u0438\u043b\u0438 <a href=\"https:\/\/www.dask.org\/\"><em>dask<\/em><\/a>. \u0425\u043e\u0442\u044f \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0438 \u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u043d\u043e \u044d\u0442\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0434\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439. <\/p>\n<p><strong>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e, \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0438\u043d\u0433 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0443\u0437\u043a\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0438 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0442\u0440\u0430\u0442\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e JSON<\/strong><\/p>\n<p>\u0412\u043e\u043e\u0440\u0443\u0436\u0438\u0432\u0448\u0438\u0441\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0438\u043d\u0433\u0430: <em>cprofile<\/em> \u0438 <em>py-spy<\/em>, \u044f \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b, \u043a\u0430\u043a\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u0434\u0430 \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0412 \u043b\u0438\u0434\u0435\u0440\u0430\u0445 \u0432 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e\u043c \u043f\u043b\u0430\u043d\u0435 \u0431\u044b\u043b\u0438 \u0432\u044b\u0437\u043e\u0432\u044b \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f <em>threading<\/em> \u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f (\u0438\u043b\u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f) JSON \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0432 <strong>Python <\/strong>\u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e (\u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c <em>json<\/em>).\u00a0<\/p>\n<p>\u0422\u043e, \u0447\u0442\u043e \u0432\u044b\u0437\u043e\u0432\u044b \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f <em>threading<\/em> \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043b\u0438\u0434\u0435\u0440\u0430\u043c\u0438, \u044f \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u043b \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c <em>multiprocessing.Pool<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <em>threading<\/em> \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043c\u0435\u0436\u0434\u0443 \u0433\u043b\u0430\u0432\u043d\u044b\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u0432 \u043f\u0443\u043b\u0435. \u0421 \u0440\u043e\u0441\u0442\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u0440\u0430\u0441\u0442\u0443\u0442, \u0438 \u0442\u0430\u043a\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0441\u0435 \u0431\u043e\u043b\u0435\u0435 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0437\u0430\u043c\u0435\u0442\u043d\u044b\u043c. \u0422\u0443\u0442 \u0432\u0440\u044f\u0434 \u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0440\u0430\u0437\u0432\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0443\u043b\u044c\u0442\u0438\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043d\u043e\u0433\u043e \u043f\u0443\u043b\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0440\u043e\u0434\u0435 <em>mpire<\/em>, \u043d\u043e \u043c\u043e\u0438 \u0431\u044b\u0441\u0442\u0440\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441 \u044d\u0442\u0438\u043c \u043f\u0430\u043a\u0435\u0442\u043e\u043c \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0445 \u043f\u0440\u0438\u0435\u043c\u0443\u0449\u0435\u0441\u0442\u0432 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438).<\/p>\n<p>\u0410 \u0432\u043e\u0442 \u0441 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0435\u0439 JSON \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 <strong>Python<\/strong> \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0447\u0435\u043c \u044f \u0438 \u0437\u0430\u043d\u044f\u043b\u0441\u044f.\u00a0<\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0438\u043d\u0433\u0430 (<em>cprofile<\/em>): <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/d_\/kw\/vn\/d_kwvn4l2od0mwkv99o09c1ydsq.png\" alt=\"\" title=\"\" width=\"auto\" height=\"auto\" data-src=\"https:\/\/habrastorage.org\/webt\/d_\/kw\/vn\/d_kwvn4l2od0mwkv99o09c1ydsq.png\"\/><figcaption><\/figcaption><\/figure>\n<h4>\u041f\u043e\u0434\u0431\u043e\u0440\u043a\u0430 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 JSON \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u043d\u0430 Python \u0438 \u0438\u0445 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/h4>\n<p>\u041f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 (\u043d\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438) \u043f\u043e \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044e \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 <strong>Python <\/strong>\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 (<strong>C<\/strong>, <strong>C++<\/strong>, <strong>Rust<\/strong>), \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <strong>Cython<\/strong> \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <strong>pypy<\/strong> (\u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u043c\u0435\u0435\u0442 \u043e\u0442\u0441\u0442\u0430\u0432\u0430\u043d\u0438\u0435 \u043e\u0442 <strong>cpython<\/strong> \u0432 \u043f\u043b\u0430\u043d\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430).\u00a0<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 JSON \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e <em>json<\/em> \u0438 \u0438\u043c\u0435\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.\u00a0<\/p>\n<p>\u0412\u043e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445:\u00a0<\/p>\n<p><a href=\"https:\/\/github.com\/ultrajson\/ultrajson\"><strong>ujson<\/strong><\/a> \u2014 \u043d\u0435\u043f\u043b\u043e\u0445\u0430\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u043d\u0430 <strong>C\/C++<\/strong>. \u0418\u0437 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 (\u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438), \u0438\u043c\u0435\u044e\u0449\u0438\u0435\u0441\u044f \u0432 <em>json<\/em>, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432 <em>ujson<\/em>;<\/p>\n<p><a href=\"https:\/\/github.com\/ijl\/orjson\"><strong>orjson<\/strong><\/a> \u2014 \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u043d\u0430 <strong>Rust<\/strong>.<strong> <\/strong>API \u043f\u043e\u0447\u0442\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u043c\u043e\u0434\u0443\u043b\u044e <em>json<\/em> (\u0437\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u043c);<\/p>\n<p><a href=\"https:\/\/github.com\/python-rapidjson\/python-rapidjson\"><strong>rapidjson<\/strong><\/a> \u2014 \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043d\u0430 <strong>C++<\/strong>.\u00a0<\/p>\n<p>\u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0435\u0441\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438. \u0411\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u043a, \u0447\u0442\u043e \u0430\u0432\u0442\u043e\u0440 \u0445\u0432\u0430\u043b\u0438\u0442 \u0438 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0442\u0430\u043a\u0438\u0445 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445. \u0421\u043b\u0435\u0434\u0443\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u00ab\u0434\u043e\u0432\u0435\u0440\u044f\u0439, \u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u00bb, \u044f \u0440\u0435\u0448\u0438\u043b \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u0442\u044c\u0441\u044f \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u043e\u0446\u0435\u043d\u043e\u043a \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e.\u00a0<\/p>\n<p>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u043e\u0432 <em>dump<\/em> \u0438 <em>load<\/em> \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043d\u0438\u0436\u0435 \u043d\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430\u0445. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 JSON \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 (\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u0432\u0438\u0434\u0435 <strong>Python <\/strong>\u0441\u043b\u043e\u0432\u0430\u0440\u044f):\u00a0<\/p>\n<pre><code class=\"python\">{     \"_id\": \"801512f3ff9658d50e47fe90\",     \"about\": \"I\u2019m currently a Senior Data Science Manager at Indeed.com, where I help our Job Search Front End, Search Matching\/Ranking, and Taxonomy teams.\",     \"address\": \"087 Simmons Greens Apt. 948\\nGinastad, LA 61807\",     \"age\": 32,     \"balance\": \"$5,583.41\",     \"birthday\": datetime.datetime(1990, 5, 4, 0, 0, 0, 0),     \"company\": \"Indeed.com\",     \"email\": \"lisahenson@indeed.com\",     \"eyeColor\": \"#e2b21f\",     \"favorite\": \"whole\",     \"friends\": [{\"id\": 63, \"name\": \"Derek Greene\"},                 {\"id\": 68, \"name\": \"Renee Doyle\"},                 {\"id\": 36, \"name\": \"James Livingston\"},                 {\"id\": 43, \"name\": \"Tyler Murphy\"}],     \"gender\": \"female\",     \"greeting\": \"Howdy!\",     \"guid\": \"749a6412-63a0-47f8-bdd8-268bd5c2162b\",     \"index\": 2566,     \"isActive\": False,     \"latitude\": 36.215487,     \"longitude\": 71.038439,     \"name\": \"Lisa Henson\",     \"phone\": \"791.126.7836x392\",     \"picture\": \"https:\/\/somehost.io\/37x29\",     \"registered\": datetime.datetime(2019, 11, 16, 19, 18, 24, 256),     \"tags\": [\"data science\",              \"internet\",              \"california\",              \"bike\",              \"lakers\",              \"food\",              \"travelling\",              \"hiking\"] }<\/code><\/pre>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/yo\/my\/a_\/yomya_-c5gmjf0cldn3nqvnzmui.png\" alt=\"loads (JSON string to Python dict)\" title=\"loads (JSON string to Python dict)\" width=\"auto\" height=\"auto\" data-src=\"https:\/\/habrastorage.org\/webt\/yo\/my\/a_\/yomya_-c5gmjf0cldn3nqvnzmui.png\"\/><figcaption>loads (JSON string to Python dict)<\/figcaption><\/figure>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/je\/6z\/gq\/je6zgq6n8xwtabit2immqarzjje.png\" alt=\"dumps (Python dict to JSON string)\" title=\"dumps (Python dict to JSON string)\" width=\"auto\" height=\"auto\" data-src=\"https:\/\/habrastorage.org\/webt\/je\/6z\/gq\/je6zgq6n8xwtabit2immqarzjje.png\"\/><figcaption>dumps (Python dict to JSON string)<\/figcaption><\/figure>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/i7\/tk\/x1\/i7tkx1hds3-ubap9xnc_mxbeah4.png\" alt=\"\" title=\"\" width=\"auto\" height=\"auto\" data-src=\"https:\/\/habrastorage.org\/webt\/i7\/tk\/x1\/i7tkx1hds3-ubap9xnc_mxbeah4.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u0431\u044b\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b \u043f\u043e\u0441\u043b\u0435 \u0434\u0435\u0441\u044f\u0442\u0438 \u043f\u0440\u043e\u0433\u043e\u043d\u043e\u0432 \u0441 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0440\u0430\u0437\u043e\u0433\u0440\u0435\u0432\u043e\u043c \u0438 \u0432\u0437\u044f\u0442\u0430 \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 JSON \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e 1, 10.000, 1.000.000 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u042d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0444\u043b\u0443\u043a\u0442\u0443\u0430\u0446\u0438\u0439, \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0445 \u043f\u043e\u0434 \u0432\u043b\u0438\u044f\u043d\u0438\u0435\u043c \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u0423\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u2014 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0437\u043e\u0432\u0430: <em>package.loads(json_str)<\/em> \u0438 <em>package.dumps(python_obj)<\/em>. \u0422\u0430\u043a\u0436\u0435 \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0435\u0432 (1-5 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438).\u00a0<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0432\u043b\u0438\u044f\u0442\u044c (\u043a\u0430\u043a \u0432 \u0445\u0443\u0434\u0448\u0443\u044e, \u0442\u0430\u043a \u0438 \u0432 \u043b\u0443\u0447\u0448\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443) \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 JSON \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435. \u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043d\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u0435, \u0431\u043b\u0438\u0437\u043a\u043e\u043c \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435.\u00a0<\/p>\n<p>\u0414\u043b\u044f \u043c\u043e\u0435\u0433\u043e \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430 \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u0435\u043c \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f <em>orjson<\/em>. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0438\u043c\u0438 \u043d\u0430 \u0442\u0435, \u0447\u0442\u043e \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u044b \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f\u0445 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.\u00a0<\/p>\n<p>\u0418\u0437\u0443\u0447\u0438\u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e <em>orjson<\/em>, \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438\/ \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 JSON \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u043c\u0435\u043d\u044b \u043f\u0430\u043a\u0435\u0442\u0430 \u0441 <em>json<\/em> \u043d\u0430 <em>orjson<\/em> \u044f \u0431\u044b\u043b \u0443\u0434\u0438\u0432\u043b\u0435\u043d \u0442\u0435\u043c, \u0447\u0442\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0434\u043d\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u0447\u0442\u0438 \u0432 2 \u0440\u0430\u0437\u0430.<\/p>\n<h4>\u0421\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0430\u0442\u044b \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c json  <\/h4>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c, \u043d\u043e \u0442\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u0412 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0434\u0430\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0432 <strong>Python <\/strong>\u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0442\u0438\u043f\u0430 <em>datetime.datetime<\/em>. \u0410 <em>json<\/em> \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 (\u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439) \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0442\u0438\u043f\u0430 datetime, \u0434\u0430 \u0438 \u043b\u044e\u0431\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u043c. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0442\u0438\u043f\u0430 <em>json.dumps()<\/em> \u0431\u0440\u043e\u0441\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u0438\u0434\u0430: <em>TypeError: Object of type datetime is not JSON serializable<\/em>. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0430\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043c.<\/p>\n<p>\u0417\u0430\u0431\u0435\u0433\u0430\u044f \u0432\u043f\u0435\u0440\u0435\u0434, \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e <em>orjson<\/em> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u0442\u044b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043d\u043e \u044d\u0442\u043e\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 \u043c\u043d\u0435 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u043b.\u00a0<\/p>\n<p>\u0412\u044b\u0445\u043e\u0434 \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0441 <em>json<\/em> \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0432 \u0432\u044b\u0437\u043e\u0432\u0435 <em>json.dumps()<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 <em>default<\/em>: <em>json.dumps(python_obj, default=custom_encoder)<\/em>. \u042d\u0442\u043e\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 callable<strong> <\/strong>\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044d\u0442\u043e\u0442 callable<strong> <\/strong>\u0434\u043b\u044f \u0442\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 <em>json.dumps()<\/em> \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e. \u0412 \u0442\u0435\u043e\u0440\u0438\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <em>default <\/em>\u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u043c \u0440\u0430\u0441\u0445\u043e\u0434\u0430\u043c \u0438, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043a \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435. \u0412\u0430\u0440\u0438\u0430\u043d\u0442 \u0431\u0435\u0437 <em>default <\/em>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0430\u0442\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u043e\u043a\u0438.\u00a0<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <em>default <\/em>\u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u0442\u0430\u043c\u0438 (\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e) \u0432 Mongo \u0438\u043b\u0438 \u0432 Django (\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 Django \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431). <\/p>\n<pre><code class=\"python\"># Mongo from bson import json_util import json  json.dumps(py_obj_with_date, default=json_util.default)  # Django from django.core.serializers.json import DjangoJSONEncoder  json.dumps(py_obj_with_date, cls=DjangoJSONEncoder)  # \u041e\u0431\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 import datetime import json  def default(obj):     if isinstance(obj, (datetime.date, datetime.datetime)):         return obj.isoformat()  json.dumps(py_obj_with_date, default=default)<\/code><\/pre>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/qo\/fa\/lk\/qofalkzawmpty1numittpq87kw4.png\" alt=\"\" title=\"\" width=\"auto\" height=\"auto\" data-src=\"https:\/\/habrastorage.org\/webt\/qo\/fa\/lk\/qofalkzawmpty1numittpq87kw4.png\"\/><figcaption><\/figcaption><\/figure>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/jh\/_o\/of\/jh_oofbuv2264d5ozpio_kft9r4.png\" alt=\"\" title=\"\" width=\"auto\" height=\"auto\" data-src=\"https:\/\/habrastorage.org\/webt\/jh\/_o\/of\/jh_oofbuv2264d5ozpio_kft9r4.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u043e\u0441\u044c, \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0442\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u0447\u0442\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043a\u0440\u0438\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e.\u00a0<br \/>\u0422\u0430\u043a \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0432 <em>default<\/em> callable<strong> <\/strong>\u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b, \u0442\u043e \u0435\u0433\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439.\u00a0<\/p>\n<h4>\u041d\u044e\u0430\u043d\u0441\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f orjson \u0438 \u043f\u043e\u0438\u0441\u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439<\/h4>\n<p><em>orjson<\/em> \u0438\u043c\u0435\u0435\u0442 \u0431\u043b\u0438\u0437\u043a\u0438\u0439 API \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c <em>json<\/em> \u0434\u043b\u044f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u0442\u044b <a href=\"https:\/\/ru.wikipedia.org\/wiki\/ISO_8601\"><em>ISO 8601<\/em><\/a>, \u0442\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 <em>orjson.dumps(pyobj)<\/em> \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442. \u041d\u043e \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u0442\u044b (\u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435), \u0442\u043e <em>orjson.dumps()<\/em> \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <em>default<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u0430\u043a \u0438 \u0432 <em>json.dumps()<\/em>. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <em>option=orjson.OPT_PASSTHROUGH_DATETIME<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 datetime \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f callable<strong> <\/strong>\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 <em>default<\/em>: <em>orjson.dumps(pyobj, default=default<\/em>,\u00a0<em>option=orjson.OPT_PASSTHROUGH_DATETIME)<\/em>\u00a0<br \/>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0441 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f <em>orjson<\/em> \u0441 \u043c\u043e\u0438\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c \u0434\u0430\u0442\u044b \u043d\u0430 <strong>Python <\/strong>\u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 <em>json<\/em>? <br \/>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u043d\u0430 <strong>Python<\/strong>, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0434\u043b\u044f <em>default<\/em>:<\/p>\n<pre><code class=\"python\">def default(obj):     if isinstance(obj, (datetime.date, datetime.datetime)):         return obj.isoformat() <\/code><\/pre>\n<p>\u041a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0434\u0435\u043b\u0430\u0435\u043c 10 \u0440\u0430\u0437 \u0438 \u0432 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0434\u043b\u044f 1 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0430 JSON \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u0442\u0443 \u0442\u0438\u043f\u0430 <em>datetime<\/em>, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0431\u0435\u0440\u0435\u043c \u043c\u0435\u0434\u0438\u0430\u043d\u0443. \u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <em>orjson<\/em> \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0434\u0430\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e: <em>orjson.dumps(obj)<\/em>.    <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/hf\/v9\/qv\/hfv9qvivnhxehw8sclpkr3b_dx8.png\" alt=\"\" title=\"\" width=\"auto\" height=\"auto\" data-src=\"https:\/\/habrastorage.org\/webt\/hf\/v9\/qv\/hfv9qvivnhxehw8sclpkr3b_dx8.png\"\/><figcaption><\/figcaption><\/figure>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/64\/wx\/ja\/64wxjagc9tyqy8dkq10vdt7ifve.png\" alt=\"\" title=\"\" width=\"auto\" height=\"auto\" data-src=\"https:\/\/habrastorage.org\/webt\/64\/wx\/ja\/64wxjagc9tyqy8dkq10vdt7ifve.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439:\u00a0<\/p>\n<p>1. <em>orjson.dumps(obj, default=default)<\/em> \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432 4 \u0440\u0430\u0437\u0430 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c <em>json(obj, default=default)<\/em>.\u00a0<\/p>\n<p>2. <em>orjson.dumps(obj)<\/em> \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432 2 \u0440\u0430\u0437\u0430 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c <em>orjson.dumps(obj, default=default)<\/em>, \u0433\u0434\u0435 <em>default<\/em> &#8212; \u00ab\u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f\u00bb \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u043d\u0430 <strong>Python<\/strong>.<\/p>\n<h4>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e datetime \u0444\u043e\u0440\u043c\u0430\u0442\u0442\u0435\u0440\u0430 \u043d\u0430 Rust \u0441 orjson<\/h4>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u043d\u0435 \u0441\u0442\u0430\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u044c\u0441\u044f \u043a \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 <em>orjson.dumps(obj)<\/em> \u0441 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043c \u0434\u0430\u0442\u044b? \u041e\u0442\u0441\u044e\u0434\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043c\u044b\u0441\u043b\u044c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f default \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 <strong>Rust <\/strong>\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443, \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u0443\u044e, \u0444\u0443\u043d\u043a\u0446\u0438\u044e.\u00a0<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 <strong>Rust <\/strong>\u0431\u0430\u0439\u043d\u0434\u0438\u043d\u0433\u0438 \u0434\u043b\u044f <strong>Python<\/strong>, \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u044b\u0431\u043e\u0440 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u043c \u043f\u0430\u043a\u0435\u0442\u0435: <a href=\"https:\/\/pyo3.rs\/main\/\"><em>PyO3<\/em><\/a>\u00a0<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f <strong>Python<\/strong>,<strong> <\/strong>\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 <strong>Rust<\/strong>, \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e \u0441\u0443\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0421\u043b\u0435\u0434\u0443\u044f \u0433\u0430\u0439\u0434\u043b\u0430\u0439\u043d\u0430\u043c <em>PyO3<\/em>, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u0438 \u043f\u0430\u0431\u043b\u0438\u0448\u0435\u0440\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"https:\/\/maturin.rs\/\"><em>Maturin<\/em><\/a> \u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0439 <em>wheel<\/em><strong> <\/strong>\u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0433 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0432 <strong>Python <\/strong>\u043f\u0440\u043e\u0435\u043a\u0442.\u00a0<\/p>\n<p>\u041f\u0440\u0438 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <em>&#8212;release<\/em> \u0444\u043b\u0430\u0433, \u0447\u0442\u043e\u0431\u044b <strong>Rust <\/strong>\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u0438\u043d\u0430\u0447\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u043a\u043e\u0434\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430 <strong>Python<\/strong>.\u00a0<\/p>\n<p>\u0414\u043b\u044f \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 <em>default<\/em> (\u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u0434, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0431\u044b\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0440\u0443\u0433\u0438\u043c):\u00a0<\/p>\n<pre><code class=\"python\">fn serialize_date(date_obj: &amp;PyDateTime) -> PyResult&lt;HashMap&lt;String, String>> {     let mut result: HashMap&lt;_, _> = HashMap::new();     result.insert(         String::from(\"$date\"),         format!(\"=={}-{:02}-{:02}T{:02}:{:02}:{:02}.{}==\",                 date_obj.get_year(),                 date_obj.get_month(),                 date_obj.get_day(),                 date_obj.get_hour(),                 date_obj.get_minute(),                 date_obj.get_second(),                 date_obj.get_microsecond())     );      Ok(result) }  #[pyfunction] fn rust_default(obj: &amp;PyAny) -> PyResult&lt;HashMap&lt;String, String>> {     if obj.is_instance::&lt;PyDateTime>()? {         return serialize_date(obj.downcast::&lt;PyDateTime>()?);     } else {         return Err(PyTypeError::new_err(\"Type is not JSON serializable\"));     } }  \/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442: \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \"\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432\" #[pyfunction] fn do_nothing(_obj: &amp;PyAny) -> PyResult&lt;String> {     Ok(String::from(\"{}\")) }  #[pymodule] fn custom(_py: Python, m: &amp;PyModule) -> PyResult&lt;()> {     m.add_function(wrap_pyfunction!(do_nothing, m)?)?;     m.add_function(wrap_pyfunction!(rust_default, m)?)?;      Ok(()) }<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u043c \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>serialize_date<\/em> \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u043d\u0430 Python:<\/p>\n<pre><code class=\"python\">def py_default(obj):     if isinstance(obj, (datetime.date, datetime.datetime)):         return {             \"$date\": (f'=={obj.year}-{obj.month:02}-{obj.day:02}T'                       f'{obj.hour:02}:{obj.minute:02}:{obj.second:02}.{obj.microsecond}==')         }<\/code><\/pre>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ym\/ch\/y-\/ymchy-tzbxxodxygkjpabjvnf2w.png\" alt=\"\" title=\"\" width=\"auto\" height=\"auto\" data-src=\"https:\/\/habrastorage.org\/webt\/ym\/ch\/y-\/ymchy-tzbxxodxygkjpabjvnf2w.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 <em>py_default<\/em> \u0438 <em>rust_default<\/em> \u0438 \u0434\u043b\u044f <em>json<\/em>, \u0438 \u0434\u043b\u044f orjson. \u0424\u0443\u043d\u043a\u0446\u0438\u044f, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u043d\u0430 <strong>Rust<\/strong>, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043d\u0430 13% \u0434\u043b\u044f <em>json<\/em> \u043c\u043e\u0434\u0443\u043b\u044f \u0438 \u043d\u0430 40% \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 <em>orjson<\/em>. \u041a\u043e\u0434, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 <strong>Rust<\/strong>, \u043e\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043c\u0430\u043a\u0440\u043e\u0441 <em>format!<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c.\u00a0<\/p>\n<h4>\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u043d\u0430 Rust<\/h4>\n<p>\u0420\u0430\u0434\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u044b\u0442\u0430\u0442\u044c \u0441\u0435\u0431\u044f \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0430 <strong>Rust <\/strong>(\u0441\u0440\u0430\u0437\u0443 \u0445\u043e\u0447\u0443 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0441\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u043e\u043c \u0432 <strong>Rust<\/strong>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043e\u0432\u0435\u0442\u044b \u0438 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0432\u043e\u0434\u0443 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445). \u041d\u0438\u0436\u0435 \u043a\u043e\u0434, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u044f \u043f\u0440\u0438\u0448\u0435\u043b \u0434\u043b\u044f \u00ab\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439\u00bb \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0430 <strong>Rust<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043d\u0430 ~15% \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u00ab\u0432 \u043b\u043e\u0431\u00bb:  <\/p>\n<pre><code class=\"python\">fn serialize_date(date_obj: &amp;PyDateTime) -> PyResult&lt;HashMap&lt;String, String>> {     let mut array: [u8; 30] = [0; 30];     let mut result: HashMap&lt;_, _> = HashMap::new();     array[0] = 61;  \/\/ =     array[1] = 61;  \/\/ =      \/\/ year     let mut year = date_obj.get_year();     let mut year_array: [u8; 4] = [0; 4];     for i in (0..=3).rev() {         year_array[i] = (year % 10) as u8;         year = year \/ 10;     }     array[2] = year_array[0] + 48;     array[3] = year_array[1] + 48;     array[4] = year_array[2] + 48;     array[5] = year_array[3] + 48;          array[6] = 45;  \/\/ -      \/\/ month     let mut month = date_obj.get_month();     let mut month_array: [u8; 2] = [0; 2];     if month &lt; 10 {         array[7] = 48;         array[8] = (month as u8) + 48;     } else {         array[8] = (month % 10) as u8 + 48;         month = month \/ 10;         array[7] = (month % 10) as u8 + 48;     }          array[9] = 45;  \/\/ -      \/\/ day     let mut day = date_obj.get_day();     let mut day_array: [u8; 2] = [0; 2];     if day &lt; 10 {         array[10] = 48;         array[11] = (day as u8) + 48;     } else {         array[11] = (day % 10) as u8 + 48;         day = day \/ 10;         array[10] = (day % 10) as u8 + 48;     }      array[12] = 84;  \/\/ T      \/\/ hour     let mut hour = date_obj.get_hour();     let mut day_array: [u8; 2] = [0; 2];     if hour &lt; 10 {         array[13] = 48;         array[14] = (hour as u8) + 48;     } else {         array[14] = (hour % 10) as u8 + 48;         hour = hour \/ 10;         array[13] = (hour % 10) as u8 + 48;     }      array[15] = 58;  \/\/ :      \/\/ minute     let mut minute = date_obj.get_minute();     let mut minute_array: [u8; 2] = [0; 2];     if minute &lt; 10 {         array[16] = 48;         array[17] = (minute as u8) + 48;     } else {         array[17] = (minute % 10) as u8 + 48;         minute = minute \/ 10;         array[16] = (minute % 10) as u8 + 48;     }      array[18] = 58;  \/\/ :      \/\/ second     let mut second = date_obj.get_second();     let mut second_array: [u8; 2] = [0; 2];     if second &lt; 10 {         array[19] = 48;         array[20] = (second as u8) + 48;     } else {         array[20] = (second % 10) as u8 + 48;         minute = second \/ 10;         array[19] = (second % 10) as u8 + 48;     }      array[21] = 46;  \/\/ .      \/\/ microsecond     let mut us = date_obj.get_microsecond();     let mut us_array: [u8; 6] = [0; 6];     for i in (0..=5).rev() {         us_array[i] = (us % 10) as u8;         us = us \/ 10;     }     array[22] = us_array[0] + 48;     array[23] = us_array[1] + 48;     array[24] = us_array[2] + 48;     array[25] = us_array[3] + 48;     array[26] = us_array[4] + 48;     array[27] = us_array[5] + 48;      array[28] = 61;  \/\/ =     array[29] = 61;  \/\/ =      let ds = str::from_utf8(&amp;array).unwrap();      result.insert(         String::from(\"$date\"),         String::from(ds)     );      Ok(result) }<\/code><\/pre>\n<p>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u0432\u0438\u0434\u0435 \u0447\u0430\u0440\u0442\u0430 \u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b: <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/-o\/ld\/yl\/-oldyl2k6grsvr0nfbxym94npmu.png\" alt=\"\" title=\"\" width=\"auto\" height=\"auto\" data-src=\"https:\/\/habrastorage.org\/webt\/-o\/ld\/yl\/-oldyl2k6grsvr0nfbxym94npmu.png\"\/><figcaption><\/figcaption><\/figure>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/kc\/t4\/ve\/kct4vebzmdzbhw6yaiwut0orrfy.png\" alt=\"\" title=\"\" width=\"auto\" height=\"auto\" data-src=\"https:\/\/habrastorage.org\/webt\/kc\/t4\/ve\/kct4vebzmdzbhw6yaiwut0orrfy.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0421 \u044d\u0442\u043e\u0439 \u00ab\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439\u00bb \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u043d\u0430 <strong>Rust <\/strong>\u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u0432 2 \u0440\u0430\u0437\u0430 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0439 \u043d\u0430 <strong>Python <\/strong>\u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <em>orjson<\/em>.\u00a0<\/p>\n<p>\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0432 \u043e \u043d\u044e\u0430\u043d\u0441\u0430\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <em>PyO3<\/em><strong> <\/strong>\u0431\u0430\u0439\u043d\u0434\u0438\u043d\u0433\u0430 \u0434\u043b\u044f <strong>Python<\/strong>:\u00a0<\/p>\n<ul>\n<li>\n<p><em>PyO3<\/em><strong> <\/strong>\u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b <strong>Python <\/strong>\u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <strong>Rust <\/strong>(\u0447\u0435\u0440\u0435\u0437 <em>trait FromPyObject)<\/em>. \u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 <strong>\u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c <\/strong>\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c <strong>Python <\/strong>\u0442\u0438\u043f\u044b \u0432 \u0440\u043e\u0434\u043d\u044b\u0435 \u0434\u043b\u044f <strong>Rust <\/strong>\u0442\u0438\u043f\u044b. \u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u00a0<strong>Python <\/strong>\u0442\u0438\u043f\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 <em>&amp;PyList)<\/em>, \u043d\u043e \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u0441\u0442\u0438\u0447\u044c \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043b\u043e\u0436\u043d\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u00ab\u0442\u044f\u0436\u0435\u043b\u044b\u0435\u00bb \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u0435\u0435 \u043f\u0435\u0440\u0435\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0430 <strong>Rust<\/strong>. <em>PyO3<\/em><strong> <\/strong>\u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f \u0438\u0437 <strong>Python <\/strong>\u0432 <strong>Rust <\/strong>\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.\u00a0<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 <strong>Python <\/strong>\u0441\u043b\u043e\u0436\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <strong>Rust <\/strong>\u0431\u0430\u0439\u043d\u0434\u0438\u043d\u0433. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <em>sum()<\/em>, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 <strong>Python<\/strong>, \u0438 \u0432\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u0435, \u0447\u0442\u043e \u043a\u043e\u0434 \u043d\u0430 <strong>Python <\/strong>\u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u043d\u0430 <strong>Rust<\/strong>. \u041f\u043e\u0447\u0435\u043c\u0443? \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0432\u0435\u0440\u0445\u044d\u0434 \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 <em>&amp;PyList \u0432 Vec&lt;i64><\/em>.\u00a0<\/p>\n<\/li>\n<\/ul>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h4>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043f\u0440\u0438\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0443 \u043d\u0430\u0441: \u043d\u0430\u0447\u0430\u043b\u0438 \u0441 \u0440\u0430\u0431\u043e\u0447\u0435\u0439, \u043d\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u0443\u0441\u043a\u043e\u0440\u0438\u043b\u0438 \u0441\u0430\u043c\u0443\u044e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u043c\u0443 JSON \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0443 \u043f\u043e\u0447\u0442\u0438 \u0432 6 \u0440\u0430\u0437 (\u0438 \u0432 2 \u0440\u0430\u0437\u0430, \u0435\u0441\u043b\u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u0438\u043a\u043e\u043c). \u041c\u0438\u043c\u043e\u0445\u043e\u0434\u043e\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.\u00a0<\/p>\n<p>\u041d\u0430\u0448\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0441\u0442\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0434\u0430\u0436\u0435 \u043d\u0435\u0432\u043e\u043e\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u043c \u0433\u043b\u0430\u0437\u043e\u043c. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c:\u00a0<\/p>\n<ul>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 (<em>orjson<\/em> \u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0434\u0430\u0442\u044b)<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 <strong>Rust <\/strong>\u0434\u043b\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u043b\u044f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u0442\u044b,\u00a0<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044e\u043d\u0438\u0442 \u0442\u0435\u0441\u0442\u044b (\u0438 \u0434\u043b\u044f <strong>Python <\/strong>\u0447\u0430\u0441\u0442\u0438 \u0438 \u0434\u043b\u044f <strong>Rust <\/strong>\u0447\u0430\u0441\u0442\u0438)<\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0434\u0430\u0442\u044b: \u043f\u043e\u0441\u043b\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043f\u0430\u043a\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u043b\u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439,\u00a0<\/p>\n<\/li>\n<li>\n<p>\u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c CI: \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.\u00a0<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u043d\u043e \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u043d\u0435\u0442? \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0435\u0448\u0430\u0435\u0442 \u0441\u0430\u043c, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u0438\u043c\u0435\u044e\u0449\u0438\u0445\u0441\u044f \u0432 \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0435\u043d\u0438\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432&#8230;\u00a0<\/p>\n<p><em>P.S.:<\/em> \u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f Python \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u0427\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u043b\u043e, \u0430 \u0447\u0442\u043e \u043d\u0435\u0442? \u0417\u0430\u0440\u0430\u043d\u0435\u0435 \u0441\u043f\u0430\u0441\u0438\u0431\u043e.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/stm_labs\/blog\/670576\/\"> https:\/\/habr.com\/ru\/company\/stm_labs\/blog\/670576\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b<\/h2>\n<h4>\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 JSON \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0430\u0440\u0445\u0438\u0432\u043d\u0443\u044e \u0411\u0414<\/h4>\n<p><em>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e \u044d\u0442\u043e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435&#8230;<\/em><\/p>\n<p>\u0412 \u043e\u0434\u0438\u043d \u0438\u0437 \u0442\u0435\u0445 \u043b\u0435\u0442\u043d\u0438\u0445 \u0434\u043d\u0435\u0439, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430 \u0443\u043b\u0438\u0446\u0435 \u0441\u0442\u043e\u044f\u043b\u0430 \u044f\u0441\u043d\u0430\u044f, \u0441\u043e\u043b\u043d\u0435\u0447\u043d\u0430\u044f, \u0436\u0430\u0440\u043a\u0430\u044f \u043f\u043e\u0433\u043e\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0441\u0442\u0440\u0438\u0436\u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u043e\u043b\u0435\u0442\u0430\u043b\u0438 \u0437\u0430 \u043e\u043a\u043d\u043e\u043c, \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u044f \u0432\u0435\u0441\u0435\u043b\u044b\u0435 \u0437\u0432\u0443\u043a\u0438, \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0443 (\u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <strong>Python<\/strong>). \u0417\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438 (\u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0438 \u0442.\u0434.) \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 (JSON \u0444\u043e\u0440\u043c\u0430\u0442), \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u044d\u0442\u0438\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 JSON \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0432 \u0430\u0440\u0445\u0438\u0432\u043d\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0432 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u044e\u043d\u0438\u0442 \u0442\u0435\u0441\u0442\u044b, \u043c\u044b \u0432\u044b\u043a\u0430\u0442\u0438\u043b\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0434\u043d\u043e \u0438\u0437 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u0438 \u0441\u0442\u0430\u043b\u0438 \u0436\u0434\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432. \u041f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043e\u0442\u043c\u0435\u043d\u043d\u043e, \u043d\u043e, \u043e\u0446\u0435\u043d\u0438\u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u044f \u0437\u0430\u0434\u0430\u043b\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c, \u0430 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0435\u0433\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c?<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<blockquote>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u0438, \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f:\u00a0<\/p>\n<p>&#8212; \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 <strong>\u0410<\/strong> (<em>\u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0440\u043e\u0434\u0435 Oracle, MySQL, Postgres, MongoDB, \u0438\u043b\u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0438\u043b\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441<\/em>) <br \/>&#8212; \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u0438 \u043e\u0431\u043e\u0433\u0430\u0449\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 <br \/>&#8212; \u0417\u0430\u043f\u0438\u0441\u044c \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 <strong>B<\/strong> \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON <\/p>\n<\/blockquote>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0448\u043b\u043e \u0432 \u0433\u043e\u043b\u043e\u0432\u0443 \u2014 \u044d\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u0421 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u0447\u0438\u0441\u043b\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u043b\u043e\u0441\u044c (\u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 N \u0440\u0430\u0437 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u043d\u043e \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0432 32 \u0440\u0430\u0437\u0430 \u0434\u043b\u044f 32 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u0442.\u043a. \u0441 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u043c \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0430 \u043f\u0430\u0434\u0430\u0442\u044c). \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435) \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u042f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432\u044b\u0437\u0432\u0430\u043d\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u044e\u0449\u0438\u043c\u0438 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u043c\u0438 \u0440\u0430\u0441\u0445\u043e\u0434\u0430\u043c\u0438 \u0434\u043b\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 (\u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 <em>MultiprocessingPool<\/em>) \u0438 \u0432\u043e\u0437\u0440\u043e\u0441\u0448\u0435\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u043d\u0430 \u0441\u0435\u0442\u044c \u0438 \u0411\u0414. \u041f\u043e\u0441\u043b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (<em>\u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0431\u044b\u043b\u043e 85 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432<\/em>) \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0432\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435.  <\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0418\u043d\u0442\u0443\u0438\u0446\u0438\u044f \u0448\u0435\u043f\u0442\u0430\u043b\u0430 \u043c\u043d\u0435, \u0447\u0442\u043e \u044d\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0432\u0441\u0451, \u0438 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043f\u043d\u0443\u0442\u044c \u0433\u043b\u0443\u0431\u0436\u0435 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.\u00a0<\/p>\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0441 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0430 <strong>Python<\/strong>, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <a href=\"https:\/\/www.ray.io\/\"><em>ray<\/em><\/a> \u0438\u043b\u0438 <a href=\"https:\/\/www.dask.org\/\"><em>dask<\/em><\/a>. \u0425\u043e\u0442\u044f \u0431\u044b\u043b\u043e \u0431\u044b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0438 \u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u043d\u043e \u044d\u0442\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0434\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439. <\/p>\n<p><strong>\u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e, \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0438\u043d\u0433 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0443\u0437\u043a\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0438 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0442\u0440\u0430\u0442\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e JSON<\/strong><\/p>\n<p>\u0412\u043e\u043e\u0440\u0443\u0436\u0438\u0432\u0448\u0438\u0441\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0438\u043d\u0433\u0430: <em>cprofile<\/em> \u0438 <em>py-spy<\/em>, \u044f \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b, \u043a\u0430\u043a\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u0434\u0430 \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0412 \u043b\u0438\u0434\u0435\u0440\u0430\u0445 \u0432 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e\u043c \u043f\u043b\u0430\u043d\u0435 \u0431\u044b\u043b\u0438 \u0432\u044b\u0437\u043e\u0432\u044b \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f <em>threading<\/em> \u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f (\u0438\u043b\u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f) JSON \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0432 <strong>Python <\/strong>\u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e (\u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c <em>json<\/em>).\u00a0<\/p>\n<p>\u0422\u043e, \u0447\u0442\u043e \u0432\u044b\u0437\u043e\u0432\u044b \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f <em>threading<\/em> \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043b\u0438\u0434\u0435\u0440\u0430\u043c\u0438, \u044f \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u043b \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c <em>multiprocessing.Pool<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <em>threading<\/em> \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043c\u0435\u0436\u0434\u0443 \u0433\u043b\u0430\u0432\u043d\u044b\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u0432 \u043f\u0443\u043b\u0435. \u0421 \u0440\u043e\u0441\u0442\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u0440\u0430\u0441\u0442\u0443\u0442, \u0438 \u0442\u0430\u043a\u043e\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0441\u0435 \u0431\u043e\u043b\u0435\u0435 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0437\u0430\u043c\u0435\u0442\u043d\u044b\u043c. \u0422\u0443\u0442 \u0432\u0440\u044f\u0434 \u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0440\u0430\u0437\u0432\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0443\u043b\u044c\u0442\u0438\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043d\u043e\u0433\u043e \u043f\u0443\u043b\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0440\u043e\u0434\u0435 <em>mpire<\/em>, \u043d\u043e \u043c\u043e\u0438 \u0431\u044b\u0441\u0442\u0440\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441 \u044d\u0442\u0438\u043c \u043f\u0430\u043a\u0435\u0442\u043e\u043c \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0445 \u043f\u0440\u0438\u0435\u043c\u0443\u0449\u0435\u0441\u0442\u0432 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438).<\/p>\n<p>\u0410 \u0432\u043e\u0442 \u0441 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0435\u0439 JSON \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 <strong>Python<\/strong> \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0447\u0435\u043c \u044f \u0438 \u0437\u0430\u043d\u044f\u043b\u0441\u044f.\u00a0<\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0438\u043d\u0433\u0430 (<em>cprofile<\/em>): <\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<h4>\u041f\u043e\u0434\u0431\u043e\u0440\u043a\u0430 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 JSON \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432 \u043d\u0430 Python \u0438 \u0438\u0445 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435<\/h4>\n<p>\u041f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 (\u043d\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438) \u043f\u043e \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044e \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 <strong>Python <\/strong>\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 (<strong>C<\/strong>, <strong>C++<\/strong>, <strong>Rust<\/strong>), \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <strong>Cython<\/strong> \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <strong>pypy<\/strong> (\u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0438\u043c\u0435\u0435\u0442 \u043e\u0442\u0441\u0442\u0430\u0432\u0430\u043d\u0438\u0435 \u043e\u0442 <strong>cpython<\/strong> \u0432 \u043f\u043b\u0430\u043d\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430).\u00a0<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 JSON \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e <em>json<\/em> \u0438 \u0438\u043c\u0435\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.\u00a0<\/p>\n<p>\u0412\u043e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445:\u00a0<\/p>\n<p><a href=\"https:\/\/github.com\/ultrajson\/ultrajson\"><strong>ujson<\/strong><\/a> \u2014 \u043d\u0435\u043f\u043b\u043e\u0445\u0430\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u043d\u0430 <strong>C\/C++<\/strong>. \u0418\u0437 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 (\u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438), \u0438\u043c\u0435\u044e\u0449\u0438\u0435\u0441\u044f \u0432 <em>json<\/em>, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432 <em>ujson<\/em>;<\/p>\n<p><a href=\"https:\/\/github.com\/ijl\/orjson\"><strong>orjson<\/strong><\/a> \u2014 \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u043d\u0430 <strong>Rust<\/strong>.<strong> <\/strong>API \u043f\u043e\u0447\u0442\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u043c\u043e\u0434\u0443\u043b\u044e <em>json<\/em> (\u0437\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u043c);<\/p>\n<p><a href=\"https:\/\/github.com\/python-rapidjson\/python-rapidjson\"><strong>rapidjson<\/strong><\/a> \u2014 \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043d\u0430 <strong>C++<\/strong>.\u00a0<\/p>\n<p>\u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0435\u0441\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438. \u0411\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u043a, \u0447\u0442\u043e \u0430\u0432\u0442\u043e\u0440 \u0445\u0432\u0430\u043b\u0438\u0442 \u0438 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0442\u0430\u043a\u0438\u0445 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445. \u0421\u043b\u0435\u0434\u0443\u044f \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u00ab\u0434\u043e\u0432\u0435\u0440\u044f\u0439, \u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u00bb, \u044f \u0440\u0435\u0448\u0438\u043b \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u0442\u044c\u0441\u044f \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u043e\u0446\u0435\u043d\u043e\u043a \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e.\u00a0<\/p>\n<p>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u043e\u0432 <em>dump<\/em> \u0438 <em>load<\/em> \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043d\u0438\u0436\u0435 \u043d\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430\u0445. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 JSON \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0444\u0430\u0439\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 (\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u0432\u0438\u0434\u0435 <strong>Python <\/strong>\u0441\u043b\u043e\u0432\u0430\u0440\u044f):\u00a0<\/p>\n<pre><code class=\"python\">{     \"_id\": \"801512f3ff9658d50e47fe90\",     \"about\": \"I\u2019m currently a Senior Data Science Manager at Indeed.com, where I help our Job Search Front End, Search Matching\/Ranking, and Taxonomy teams.\",     \"address\": \"087 Simmons Greens Apt. 948\\nGinastad, LA 61807\",     \"age\": 32,     \"balance\": \"$5,583.41\",     \"birthday\": datetime.datetime(1990, 5, 4, 0, 0, 0, 0),     \"company\": \"Indeed.com\",     \"email\": \"lisahenson@indeed.com\",     \"eyeColor\": \"#e2b21f\",     \"favorite\": \"whole\",     \"friends\": [{\"id\": 63, \"name\": \"Derek Greene\"},                 {\"id\": 68, \"name\": \"Renee Doyle\"},                 {\"id\": 36, \"name\": \"James Livingston\"},                 {\"id\": 43, \"name\": \"Tyler Murphy\"}],     \"gender\": \"female\",     \"greeting\": \"Howdy!\",     \"guid\": \"749a6412-63a0-47f8-bdd8-268bd5c2162b\",     \"index\": 2566,     \"isActive\": False,     \"latitude\": 36.215487,     \"longitude\": 71.038439,     \"name\": \"Lisa Henson\",     \"phone\": \"791.126.7836x392\",     \"picture\": \"https:\/\/somehost.io\/37x29\",     \"registered\": datetime.datetime(2019, 11, 16, 19, 18, 24, 256),     \"tags\": [\"data science\",              \"internet\",              \"california\",              \"bike\",              \"lakers\",              \"food\",              \"travelling\",              \"hiking\"] }<\/code><\/pre>\n<figure class=\"\"><figcaption>loads (JSON string to Python dict)<\/figcaption><\/figure>\n<figure class=\"\"><figcaption>dumps (Python dict to JSON string)<\/figcaption><\/figure>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u0431\u044b\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b \u043f\u043e\u0441\u043b\u0435 \u0434\u0435\u0441\u044f\u0442\u0438 \u043f\u0440\u043e\u0433\u043e\u043d\u043e\u0432 \u0441 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0440\u0430\u0437\u043e\u0433\u0440\u0435\u0432\u043e\u043c \u0438 \u0432\u0437\u044f\u0442\u0430 \u043c\u0435\u0434\u0438\u0430\u043d\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 JSON \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e 1, 10.000, 1.000.000 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u042d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0444\u043b\u0443\u043a\u0442\u0443\u0430\u0446\u0438\u0439, \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0449\u0438\u0445 \u043f\u043e\u0434 \u0432\u043b\u0438\u044f\u043d\u0438\u0435\u043c \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u0423\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u2014 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0437\u043e\u0432\u0430: <em>package.loads(json_str)<\/em> \u0438 <em>package.dumps(python_obj)<\/em>. \u0422\u0430\u043a\u0436\u0435 \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043b\u0441\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0435\u0432 (1-5 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438).\u00a0<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0432\u043b\u0438\u044f\u0442\u044c (\u043a\u0430\u043a \u0432 \u0445\u0443\u0434\u0448\u0443\u044e, \u0442\u0430\u043a \u0438 \u0432 \u043b\u0443\u0447\u0448\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443) \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 JSON \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435. \u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043d\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u0435, \u0431\u043b\u0438\u0437\u043a\u043e\u043c \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435.\u00a0<\/p>\n<p>\u0414\u043b\u044f \u043c\u043e\u0435\u0433\u043e \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430 \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u0435\u043c \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f <em>orjson<\/em>. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0445\u043e\u0436\u0438\u043c\u0438 \u043d\u0430 \u0442\u0435, \u0447\u0442\u043e \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u044b \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f\u0445 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.\u00a0<\/p>\n<p>\u0418\u0437\u0443\u0447\u0438\u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e <em>orjson<\/em>, \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438\/ \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 JSON \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u043c\u0435\u043d\u044b \u043f\u0430\u043a\u0435\u0442\u0430 \u0441 <em>json<\/em> \u043d\u0430 <em>orjson<\/em> \u044f \u0431\u044b\u043b \u0443\u0434\u0438\u0432\u043b\u0435\u043d \u0442\u0435\u043c, \u0447\u0442\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0434\u043d\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u0447\u0442\u0438 \u0432 2 \u0440\u0430\u0437\u0430.<\/p>\n<h4>\u0421\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0430\u0442\u044b \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c json  <\/h4>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c, \u043d\u043e \u0442\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u0412 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0434\u0430\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0432 <strong>Python <\/strong>\u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438\u0441\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0442\u0438\u043f\u0430 <em>datetime.datetime<\/em>. \u0410 <em>json<\/em> \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 (\u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439) \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0442\u0438\u043f\u0430 datetime, \u0434\u0430 \u0438 \u043b\u044e\u0431\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u043c. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0442\u0438\u043f\u0430 <em>json.dumps()<\/em> \u0431\u0440\u043e\u0441\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u0438\u0434\u0430: <em>TypeError: Object of type datetime is not JSON serializable<\/em>. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0430\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043c.<\/p>\n<p>\u0417\u0430\u0431\u0435\u0433\u0430\u044f \u0432\u043f\u0435\u0440\u0435\u0434, \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e <em>orjson<\/em> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u0442\u044b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043d\u043e \u044d\u0442\u043e\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 \u043c\u043d\u0435 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u043b.\u00a0<\/p>\n<p>\u0412\u044b\u0445\u043e\u0434 \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0441 <em>json<\/em> \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0432 \u0432\u044b\u0437\u043e\u0432\u0435 <em>json.dumps()<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 <em>default<\/em>: <em>json.dumps(python_obj, default=custom_encoder)<\/em>. \u042d\u0442\u043e\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 callable<strong> <\/strong>\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044d\u0442\u043e\u0442 callable<strong> <\/strong>\u0434\u043b\u044f \u0442\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 <em>json.dumps()<\/em> \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e. \u0412 \u0442\u0435\u043e\u0440\u0438\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <em>default <\/em>\u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u043c \u0440\u0430\u0441\u0445\u043e\u0434\u0430\u043c \u0438, \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043a \u0431\u043e\u043b\u0435\u0435 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435. \u0412\u0430\u0440\u0438\u0430\u043d\u0442 \u0431\u0435\u0437 <em>default <\/em>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0430\u0442\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u043e\u043a\u0438.\u00a0<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <em>default <\/em>\u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u0442\u0430\u043c\u0438 (\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e) \u0432 Mongo \u0438\u043b\u0438 \u0432 Django (\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 Django \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431). <\/p>\n<pre><code class=\"python\"># Mongo from bson import json_util import json  json.dumps(py_obj_with_date, default=json_util.default)  # Django from django.core.serializers.json import DjangoJSONEncoder  json.dumps(py_obj_with_date, cls=DjangoJSONEncoder)  # \u041e\u0431\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 import datetime import json  def default(obj):     if isinstance(obj, (datetime.date, datetime.datetime)):         return obj.isoformat()  json.dumps(py_obj_with_date, default=default)<\/code><\/pre>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a \u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u043e\u0441\u044c, \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0442\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e, \u0447\u0442\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043a\u0440\u0438\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e.\u00a0<br \/>\u0422\u0430\u043a \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0432 <em>default<\/em> callable<strong> <\/strong>\u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b, \u0442\u043e \u0435\u0433\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439.\u00a0<\/p>\n<h4>\u041d\u044e\u0430\u043d\u0441\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f orjson \u0438 \u043f\u043e\u0438\u0441\u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439<\/h4>\n<p><em>orjson<\/em> \u0438\u043c\u0435\u0435\u0442 \u0431\u043b\u0438\u0437\u043a\u0438\u0439 API \u0441 \u043c\u043e\u0434\u0443\u043b\u0435\u043c <em>json<\/em> \u0434\u043b\u044f \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u0442\u044b <a href=\"https:\/\/ru.wikipedia.org\/wiki\/ISO_8601\"><em>ISO 8601<\/em><\/a>, \u0442\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 <em>orjson.dumps(pyobj)<\/em> \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442. \u041d\u043e \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-334262","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/334262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=334262"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/334262\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=334262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=334262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=334262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}