性能最佳实践
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
每项操作上传商品需要一定的时间。如果您需要
需要在短时间内上传大量商品
看起来很慢
我们推荐的解决方案是并行调用 CSS API。
并行通话
为了加快上传流程,我们建议您使用并行调用来上传
多款产品。这可能会显著降低
。使用适当的功能
自定义语言
对于 Java,请在并行执行器中使用异步版本:
ApiFuture<CssProductInput> future =
cssProductInputsServiceClient.insertCssProductInputCallable().futureCall(request);
批量 / 批量操作
虽然 CSS 中不直接支持批量操作和批量操作
如果您是使用 HTTP 直接调用 API,则可以使用 Google API
默认批处理特征。有关详细说明,请参阅
Media-CDN
或Cloud Storage
文档。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eUploading many products using the CSS API can be time-consuming due to individual operation times.\u003c/p\u003e\n"],["\u003cp\u003eTo expedite the upload process, leverage parallel calls to upload multiple products concurrently, significantly reducing the overall upload time.\u003c/p\u003e\n"],["\u003cp\u003eThough the CSS API doesn't directly support bulk/batch operations, when using HTTP directly, you can utilize the Google API default batch feature for enhanced efficiency, as detailed in the Media-CDN or Cloud Storage documentation.\u003c/p\u003e\n"]]],[],null,["# Performance best practices\n\nUploading products takes a certain amount of time per operation. If you need\nto upload many products in a short timeframe, this could cause the\nprocess to seem slow.\n\nOur recommended solution is to call the CSS API in parallel.\n\nParallel calls\n--------------\n\nTo speed up the upload process, we recommend using parallel calls to upload\nmultiple products simultaneously. This can significantly reduce overall\nupload time. Use the features appropriate\nfor your programming language.\n\nFor Java, use the asynchronous version within a parallel executor: \n\n ApiFuture\u003cCssProductInput\u003e future =\n cssProductInputsServiceClient.insertCssProductInputCallable().futureCall(request);\n\nBulk / Batch operations\n-----------------------\n\nWhile bulk and batch operations aren't supported directly in the CSS\nAPI, if you are calling the API directly using HTTP you can use the Google API\ndefault batch feature. For detailed instructions, refer to the\n[Media-CDN](https://cloud.google.com/media-cdn/docs/api/batch)\nor the [Cloud Storage](https://cloud.google.com/storage/docs/batch)\ndocumentation."]]