doulao2916 2011-09-27 10:35
浏览 31
已采纳

处理php和mysql的最快方法?

I am looking for any kind of way to process php & mysql faster than my MacBook Pro running XAMPP is able to do.

I have written an application, that has to process a lot of data for some simulations. On my MB, this takes about half an hour each time I want run a simulation. Not so very handy.

Is there a good (and cheap) way to process these simulations a bit faster? I already enabled MySQL-Caches and PHP eAccelerator - but it's just simply too slow. I'd love a service, where I could place some MySQL-DB, some PHP and gain a lot of processing-power.

Is there something faster than XAMPP to tun this?

  • 写回答

2条回答 默认 最新

  • dongyou9818 2011-09-27 10:45
    关注

    Generally speaking, performance is difficult to determine without going into details about your implementation so I can't really offer much advice beyond a few tips:

    As the commenters mention, PHP isn't designed for number crunching; something like Python, Java, or C++ are far better suited to this kind of task.

    Is 30 minutes a reasonable amount of time for the task to take? Assuming it takes 10 minutes less, will that actually be worth spending money on? Better planning and running jobs overnight is far cheaper :)

    As far as alternatives go you could try running your jobs on an Amazon EC2 instance, which may give you a bit of a speed boost but you'll still be running on one core; so your simulation will run roughly as quickly, ignoring input/output.

    If you actually want to optimise it, profile your application. You need to know where the time's being spent so you can figure out which parts you should spend time optimising; once you know which part of the code takes so long you should be able to try different approaches to get it working faster. Make sure you know the quirks of PHP, there are some surprising performance differences you might not be aware of. Optimisation can help, but always make sure your time spent doing it is going to be worth the time it saves.

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

报告相同问题?

悬赏问题

  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services