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 python变量和列表之间的相互影响
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)