Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-17-2008, 02:33 PM
Junior Member
 
Join Date: Jun 2008
Posts: 3
Exclamation Zend_Currency VERY slow? (help!)

Hey,

First post on the forum, it's a great resource been reading posts for a while... now I seem to have a problem of my own!

I have been using Zend Framework for a while now in various projects. I recently undertook a project that requires the use of currency. Naturally, I saw that Zend_Framework had Zend_Currency. I decided to give it a shot.

Midway in the project, I noticed my load times were hitting +1 seconds from 0.0xxx, after some trouble shooting I noticed it was coming from Zend_Currency. When I was creating multiple (or even a single) Zend_Currency object it was taking 1.0 to 2.0 seconds in the constructor...

Here is a snippet of code that I created to test.
PHP Code:
<?php
    
for($i 0$i 10$i++) {
          
$currency = new Zend_Currency('en_US''USD');
          
//echo $currency->toCurrency(1000) .'<br>'; //If I uncomment this it does NOT add any significant load.        
     
}
?>
If I set 10 as the max it takes about ~3.5xxx seconds to load.
If I set 1 as the max it takes about ~1.5xxx seconds to load.
(If I set it @ 0 it takes 0.00xx seconds to load)

I think this is very odd for Zend Framework. Everything else is lightning fast. This is why i'm thinking it's something i'm doing wrong. I was wondering if anyone has encountered this. If there is some type of config I need to do in the Zend_Locale or Currency that i'm overlooking? Or If i'm doing it totally wrong?

I am currently using Zend_Db and Zend_Acl with no troubles @ all.
p.s. I did RTFM several times!

**********
2008-06-24 Edit

I'm trying to achieve long lists of correctly formatted transactions using Zend_Currency

Last edited by MrStuff : 06-24-2008 at 12:43 PM. Reason: Code brackets for example.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-24-2008, 08:10 AM
SpotSec's Avatar
Senior Member
 
Join Date: Feb 2007
Location: United States
Posts: 121
Default

are you using zend_cache?
__________________
Zym Framework - A Zend Framework extension library w/ demo app

SpotSec Blog:
http://spotsec.com/blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-24-2008, 11:16 AM
Junior Member
 
Join Date: Jun 2008
Posts: 3
Default

I am not @ this point. Should this be used with Zend Cache?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-04-2008, 06:26 PM
Member
 
Join Date: Aug 2008
Posts: 55
Default

Setting no cache is like driving 20mph where 120 are allowed
__________________
Greetings
Thomas Weidner
I18N Team Leader, Zend Framework
http://www.thomasweidner.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 08-05-2008, 03:48 PM
gog gog is offline
Junior Member
 
Join Date: Jul 2008
Posts: 8
Default

Creating many Zend_Date objects slows the page generation time as well. Creating an istance of Zend_Date is quite slow.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:01 PM.