FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
||||
|
||||
Pero...que raro, el rendimiento de la red cambia
Hola Compis. Pongo este hilo en varios pero el moderador que lo considere lo mueva a donde corresponda. Gracias ante todo por estar ahi.
Tengo un mosqueo ... ...... a ver como lo explico. Tengo una aplicación que realiza consultas a unos dispositivos hardware para captura de datos. Que conste que funciona perfectamente, el caso es el siguiente: La velocidad de lectura es variable entre 1 y 1000 lecturas por segundo y canal (ahora uso 4 canales), hasta hay bien. lo pongo a 1000 y me lee unas 960 (casi 4000 en los 4 canales), normal, la pongo a 200 y me lee 199 o 200, normal, la pongo a 1 y me lee 1, vale, cierro el compilador, ejecuto el .Exe y ....... en ningun caso pasa de 64 lecturas por segundo.... Abro el compilador (sigue ejecutandose el .Exe) y ...... "voila" las lecturas vuelven a "su ser", a máxima velocidad. Cierro el compilador y ....... bajan a 64 por segundo. Pero increiblemente esto tambien sucede cuando abro el navegador "NigthLight" sube o baja el rendimiento si el navegador estar abierto o cerrado. No ocurre con Intenet Explorer 32 o 64 bit. Parece claro que es algo de que guindows "frena" el rendimiento y en cambio Enbarcadero o Mozilla "aceleran la red". Imagen en "modo lento" Imagen en modo "rápido" Se os ocurre como puedo "distribuir" el programa sin tener que decirle al cliente...."Ya" pero tienes que tener el navegador abierto y dentro de una página web" (NT: con la pagina de inicio todavia no se acelera, ahi que visitar por ejemplo wwww.clubdelphi.com). Gracias por las posibles respuestas. Un saludo. Última edición por cesarsoftware fecha: 04-10-2012 a las 12:09:05. |
#2
|
||||
|
||||
Hola me respondo porque no puedo editar
Este es el codigo de la thread que realiza la funcion, ya se que no es necesario verla para el caso que nos ocupa, pero no todo va a ser pedir, puede que ha alguien le resulte muy util para saber como hacer thread de lectura TCP/IP y puerto serie (ojo las unidades UnitComm y PComm no van incluidas en delphi)
Última edición por cesarsoftware fecha: 04-10-2012 a las 13:06:02. |
#3
|
||||
|
||||
me paso algo parecido con unos componentes que eran pagos, que mientras ejecutabas desde delphi andaba todo perfecto, pero cuando lo lleve a la maquina del cliente aparecian unos carteles de "DEMO" y me ponia un par de limitaciones. El componente no tenia nada que ver con la red, pero se me ocurre que si usas algun componente extra para hacer tus conexiones por ahi te este pasando algo similar. Es un pensamiento en el aire nomas.
Saludos |
#4
|
||||
|
||||
Que va, los componentes son los indy (uso Delphi 10), por el puerto serie van "a toda mecha" (uso esas librerias pcomm desde hace al menos 10 años).
Pero es que ahora e visto que me pasa en otros programas que tengo hechos para la industria. Juraria que con Delphi 7 esto no pasaba. A ver si a alguien se le ocurre algo mas. Thanks |
#5
|
|||
|
|||
Cita:
|
#6
|
||||
|
||||
Gracias por vuestras respuestas, pero a lo mejor no me he explicado bien.
La libreria Pcomm (puerto serie) funciona siempre a la velocidad correcta, no tengo problemas con ella, esta incluida en la unidad publicada porque esta diseñada para enviar/recibir tanto por puerto serie como por ethernet por eso veo las diferencias de rendimiento. El problema esta en ethernet y los componentes que usa son los Indy, que si vienen con Delphi. .... Pero ..... ya se donde esta el problema Estos dias he modificado el codigo para usar sockets (via WinSock) y ahora se donde se acelera/desacelera el rendimiento de la red. El problema, si se le puede llamar asi, esta en la funcion que comprueba si el buffer tiene algo para leer o no. Con el compilador abierto o el nigthtly activo esta funcion retorna inmediatamente e indica en "&InBuffer" cuantos bytes ahi para leer, 0 para ninguno u otro valor si ahi algo, entonces se llama a la funcion de lectura para leer el contenido del buffer en "rxBuffer". Lo que pasa es que si el compilador esta cerrado (y por tanto sus librerias) entonces se usan las de windows (o eso creo yo), en concreto esta funcion usa "Ws2_32.dll" Y parece ser que esta libreria en su funcion ioctlsocket no devuelve nada y espera a que tenga algo en el buffer para retornar y de ahi su lentitud o no entiendo muy bien lo que pasa con esa funcion pues si se la quito y solo uso "recv" siempre va lento. Este es el codigo completo para la lectura
Lo que ahora no se es como solucionarlo si consiguiendo otra ws2_32.dl o se os ocurre algo. Gracias. Última edición por cesarsoftware fecha: 09-10-2012 a las 13:27:22. |
Herramientas | Buscar en Tema |
Desplegado | |
|
|
Temas Similares | ||||
Tema | Autor | Foro | Respuestas | Último mensaje |
Enumerado raro raro | Guillermo80 | C++ Builder | 5 | 08-03-2008 23:34:29 |
Conectar una db con otra pero estando en un pc diferente pero en red | solram | MySQL | 0 | 04-07-2007 22:41:32 |
rendimiento de PHP | Ñuño Martínez | PHP | 1 | 20-09-2006 06:29:55 |
rendimiento | carlomagno | Firebird e Interbase | 14 | 06-07-2004 17:05:13 |
|