Jump to content

Speed performance.


wepnop

Recommended Posts

Im going to use a large array of arrays, each of one having a lot of values and some sub arrays. My question is...  is faster to use arrays or is better to have a object to acces using methods and all? i suppose objects are slower...

 

Also i was planing in use arrays with string keys in nearly all places, normally these are slower, but in php hashes and arrays are the same tipe  so i dont know...

Link to comment
Share on other sites

How LARGE is large?

 

This is my actual code, but it can grow more, it will have like 15 items or more of these tipe maybe, because its a inventory aplication.

$categorias['Memoria Ram'] = array(
# El nombre ha de coincidir con el de la tabla sql
'nombre' => 'Memoria RAM',
# Titulo de la pagina
'titulo' => 'Insertar memoria RAM',
# Encabezado de la pagina
'encabezado' => 'Insertar memoria RAM',
# Campos del formulario, tipo, nombre y descripcion para cada uno. Ordenados como saldran.
'campos'  =>  array(
	0 => array(
		'tipo' => 1,
		'nombre' => 'Cantidad',
		'descripcion' => 'La cantidad de MB de capacidad.'
	),
	1 => array(
		'tipo' => 2,
		'nombre' => 'Tipo',
		'descripcion' => 'El tipo de memoria RAM'
	),
	2 => array(
		# Tipo: 1: numero, 2: texto, 3: lista de opciones
		'tipo' => 3,
		# Ha de coincidir con el campo sql
		'nombre sql' => 'Tecnologia',
		# Nombre usado por la web
		'nombre' => 'Tecnologia',
		# Descripcion del elemento
		'descripcion' => 'El tipo de tecnologia de la memoria RAM',
		# Solo se usaria la lista en caso de tipo3
		'opciones' => array('DDR', 'DDR2', 'DDR3', 'SDR')
	)

 

The correct is the last one, that uses more entries in the hash. The $campos array may be somewhat large also. I suppose that i will add some extra info to it, anyway, these are sketches, and this have to be readed frecuently.

Link to comment
Share on other sites

  • 3 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.