परफ़ॉर्मेंस को बेहतर करें
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
gzip के बारे में
यह क्लाइंट लाइब्रेरी, एपीआई के सभी रिस्पॉन्स और अनज़िप के लिए, gzip संपीड़न का अनुरोध करती है
तैयार करना होगा.
हालांकि, नतीजों को कंप्रेस करने के लिए ज़्यादा सीपीयू समय की ज़रूरत होती है,
नेटवर्क की कीमतों के साथ तालमेल बिठाना आम तौर पर फ़ायदेमंद हो जाता है.
अधूरे जवाब (फ़ील्ड पैरामीटर)
डिफ़ॉल्ट रूप से, अनुरोधों को प्रोसेस करने के बाद सर्वर किसी संसाधन को पूरी तरह से दिखाने का अनुरोध करता है.
बेहतर परफ़ॉर्मेंस के लिए,
तो आप सर्वर से सिर्फ़ उन फ़ील्ड को भेजने के लिए कह सकते हैं जिनकी आपको वाकई ज़रूरत है और इसके बजाय आंशिक जवाब पाएं.
अधूरा जवाब पाने का अनुरोध करने के लिए,
एपीआई के किसी भी तरीके में स्टैंडर्ड Fields
पैरामीटर जोड़ें.
इस पैरामीटर की वैल्यू से उन फ़ील्ड के बारे में पता चलता है जिन्हें आपको लौटाना है.
इस पैरामीटर का इस्तेमाल, ऐसे किसी भी अनुरोध के साथ किया जा सकता है जो रिस्पॉन्स डेटा दिखाता है.
नीचे दिए गए कोड स्निपेट में,
खोज सेवा की GetRest
विधि को कॉल किया जाता है.
Fields
पैरामीटर की वैल्यू description,title
पर सेट है.
इस वजह से, दिखाए गए ऑब्जेक्ट में सिर्फ़ जानकारी और टाइटल वाले फ़ील्ड शामिल होंगे.
var service = new DiscoveryService();
var request = service.Apis.GetRest("calendar", "v3");
request.Fields = "description,title";
var result = request.Execute();
ध्यान दें कि मनचाहे फ़ील्ड को सीमित करने के लिए कॉमा का इस्तेमाल कैसे किया जाता है,
और स्लैश का इस्तेमाल उन फ़ील्ड को दिखाने के लिए किया जाता है जो पैरंट फ़ील्ड में शामिल होते हैं.
Fields
पैरामीटर के लिए फ़ॉर्मैटिंग के दूसरे विकल्प भी हैं;
ज़्यादा जानकारी के लिए, "परफ़ॉर्मेंस के बारे में सलाह" देखें. पेज
आपके इस्तेमाल किए जा रहे एपीआई के दस्तावेज़ में.
कुछ हद तक अपडेट (पैच)
अगर जिस एपीआई को कॉल किया जा रहा है वह पैच के साथ काम करता है,
संसाधनों में बदलाव करते समय, गैर-ज़रूरी डेटा भेजने से बचा जा सकता है.
इन एपीआई के लिए, Patch
तरीके को कॉल किया जा सकता है और
वे आर्ग्युमेंट उपलब्ध कराएं जिनमें आपको संसाधन के लिए बदलाव करना है.
पैच सिमेंटिक्स के बारे में ज़्यादा जानकारी के लिए,
"परफ़ॉर्मेंस के बारे में सलाह" देखें पेज पर जाएं.
बैच
अगर आपके पास कई छोटे-छोटे अनुरोध हैं, तो आपको फ़ायदा मिल सकता है
बैचिंग,
की मदद से, उन अनुरोधों को एक एचटीटीपी अनुरोध में बंडल किया जा सकता है.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eThis document provides techniques to enhance your application's performance by reducing network costs and unnecessary data transfers.\u003c/p\u003e\n"],["\u003cp\u003eUtilize the \u003ccode\u003eFields\u003c/code\u003e parameter for partial responses, retrieving only the necessary data from the server.\u003c/p\u003e\n"],["\u003cp\u003eEmploy \u003ccode\u003ePatch\u003c/code\u003e for partial updates, sending only modified data when making changes to resources.\u003c/p\u003e\n"],["\u003cp\u003eLeverage batching to combine multiple small requests into a single HTTP request, reducing overhead.\u003c/p\u003e\n"],["\u003cp\u003eConsult the specific API documentation's "Performance Tips" page for detailed guidance on these techniques.\u003c/p\u003e\n"]]],[],null,["# Improve Performance\n\nThis document covers techniques you can use to improve the performance of your application.\nThe documentation for the specific API you are using should have a\nsimilar page with more detail on some of these topics.\nFor example, see the\n[Performance Tips page for the Google Drive API](/drive/performance).\n\nAbout gzip\n----------\n\n\nThis client library requests gzip compression for all API responses and unzips\nthe data for you.\nAlthough this requires additional CPU time to uncompress the results,\nthe tradeoff with network costs usually makes it worthwhile.\n\nPartial response (fields parameter)\n-----------------------------------\n\n\nBy default, the server sends back the full representation of a resource after processing requests.\nFor better performance,\nyou can ask the server to send only the fields you really need and get a *partial response* instead.\n\n\nTo request a partial response,\nadd the standard `Fields` parameter to any API method.\nThe value of this parameter specifies the fields you want returned.\nYou can use this parameter with any request that returns response data.\n\n\nIn the following code snippet,\nthe `GetRest` method of the Discovery service is called.\nThe value of the `Fields` parameter is set to `description,title`.\nAs a result, the returned object will include only the description and title fields. \n\n```gdscript\nvar service = new DiscoveryService();\nvar request = service.Apis.GetRest(\"calendar\", \"v3\");\nrequest.Fields = \"description,title\";\nvar result = request.Execute();\n \n```\n\n\nNote how commas are used to delimit the desired fields,\nand slashes are used to indicate fields that are contained in parent fields.\nThere are other formatting options for the `Fields` parameter;\nfor details, see the \"Performance Tips\" page\nin the documentation for the API you are using.\n\nPartial update (patch)\n----------------------\n\n\nIf the API you are calling supports patch,\nyou can avoid sending unnecessary data when modifying resources.\nFor these APIs, you can call the `Patch` method and\nsupply the arguments you wish to modify for the resource.\n\n\nFor more information about patch semantics,\nsee the \"Performance Tips\" page in the documentation for the API you are using.\n\nBatch\n-----\n\n\nIf you are sending many small requests you may benefit from\n[batching](/api-client-library/dotnet/guide/batch),\nwhich allows those requests to be bundled into a single HTTP request."]]