performance

Real file transfer test among eSATA, Firewire400 and USB 2.0

Today I have tested file transfer rate of my external hdd, WD My Book Home Edition 1TB, via all 3 interfaces.

First with eSATA, the transfer rate went up to 66 MB/s.

Secondly by Firewire 400, it can do around 31 MB/s.

At last, through USB 2.0, only 29 MB/s can be reached.

Umm, and where is 3Gb/s specification! -- Just kidding.

PHP: Performance tips

Tip จากพี่ใหญ่ใจดี Google ครับ
ต้นฉบับ: http://code.google.com/speed/articles/optimizing-php.html
ผู้เขียน: Eric Higgins, Google Webmaster

PHP Performance Tips

  • อย่า copy ตัวแปรอย่างไร้ประโยชน์
    ในบางครั้งมือใหม่ PHP จะพยายามทำให้ code ดูสะอาดอ่านง่ายขึ้นด้วยการ copy ค่ามาใส่ตัวแปรที่ชื่อสั้น ๆ ซึ่งทำให้เปลือง memory เพิ่มขึ้นอีกเท่าหนึ่ง และแน่นอนทำให้ช้าลงด้วย จากตัวอย่างด้านล่าง ถ้า user ส่ง description ขนาด 512kB เข้ามาทาง textarea จะทำให้กิน memory ถึง 1MB เลยทีเดียว
    BAD: $description = $_POST['description']; echo $description;
    
Syndicate content