doushan3511 2013-08-12 22:12
浏览 40
已采纳

远程请求的数量是否会影响性能?

I have a photobook making site and i'm trying to improve loading and saving performance.

The photobook making tool is displayed in a web browser, is done in Flash, and the remote calls for database operations are done through AmfPhp.

The algorithm for saving a photobook basically says:

foreach(page in photobook){
    foreach(component in page){
        //Make a remote call that saves the component in the Database
    }
}

This means that if a photobook has 30 pages, with 10 components(photos) per page, the tool will create approximately 300 simultaneous connections without counting the uploads connections.

Firefox for example, seems to all ready create a queue to process the requests.

Does this affects the performance at all?

Will it help to create a queue that controls the number of simultaneous remote calls?

Is it worth it?

Thank you for any help you can give me.

  • 写回答

2条回答 默认 最新

  • dsgdg46465 2013-08-12 23:31
    关注

    Every request to remote server will result in time increase for your script execution.

    3 queries to database are faster then 3 remote requests.

    So yes your performance will be heavily impacted with 300 remote requests.

    Best solution is to either paginate, or serialize all of data in XML. Though careful with XML, if too big it will cause performance issue as well.

    I think pagination is the best option.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 BP神经网络控制倒立摆
  • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
  • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算