Welcome Guest, Not a member yet? Register   Sign In
General: Speed issue when creating forms??
#1

[eluser]123wesweat[/eluser]
Hi,

I was wondering which approach is better when creating a form and looking for optimize

Code:
<p>&lt;?php echo form_label('username: ').form_input('username');?&gt;
        <span class="error">&lt;?php echo form_error('username'); ?&gt;</span></p>
    <p>&lt;?php echo form_label('website: ').form_input('website');?&gt;
        <span class="error">&lt;?php echo form_error('website'); ?&gt;</span></p>

or

just plain html
Code:
<p><label>username: </label>&lt;input type="text" name="username" value=""  /&gt;        <span class="error"></span></p>
    <p><label>website: </label>&lt;input type="text" name="website" value=""  /&gt;        <span class="error"></span></p>

CI form library is awesome and easy to use, but php is opened and closed each time??? This might be a speed issue or not???

Any tips/suggestions??
#2

[eluser]Mareshal[/eluser]
I am not using CI's form helper. Just plain html and sometimes I need set_value() from form_validation
#3

[eluser]danmontgomery[/eluser]
Opening and closing php tags don't have any impact on execution time. However, no php will always be faster than some php.
#4

[eluser]Mareshal[/eluser]
html is executed by browser, and php is first interpreted by php compiler and then sent to browser. And CI form helper makes first a lot of includes before output
#5

[eluser]123wesweat[/eluser]
[quote author="Mareshal" date="1265248441"]html is executed by browser, and php is first interpreted by php compiler and then sent to browser. And CI form helper makes first a lot of includes before output[/quote]

So the weak link/main subject is the server (hosting company)??
#6

[eluser]Mareshal[/eluser]
not really, but definitely a good server will handle better the php compiler. For example I was working now on a CI project and I saw that every query, no matter how long is, and now matter what's doing in DB is executed in max 0.0002, but most of them in 0.0001 . On my old host this was taking about 0.0009. So, yes, the hosting server influences the results




Theme © iAndrew 2016 - Forum software by © MyBB