1. Ports
- Posted by Robert Craig <rds at EMAIL.MSN.COM> Jan 03, 1998
- 549 views
- Last edited Jan 04, 1998
Peter Blue and Ralf have suggested that Port I/O routines be added to ex.exe. I'm wondering if there are any applications (real or imagined) that would need better port I/O speed than is provided in Jacques Deschenes ports.e. I timed his 8-bit Input() routine on a 486 DX-50. I wanted to know the extra "overhead" from executing his Euphoria statements. I measured (simulated) how long it would take to read 56K bits (at 8-bits per read). I concluded it would be about 0.32 seconds. (I left out the actual call() that does the port access - it should be pretty fast and would be needed in an ex.exe implementation anyway.). If you replace: poke(InputAsm+3, int_to_bytes(port)) with: poke4(InputAsm+3, port) (poke4 is new in 2.0 alpha) the time drops to just .08 seconds. (Remember to say: "without type_check" - he has some user-defined types.) You can reduce the time a bit further by removing his test: if not InputAsm then return -1 end if You could also avoid adding 3 to InputAsm each time etc. So my feeling is that you could handle a 56K / sec. modem and only 8% or less of the time would go into "Euphoria overhead for Port I/O". With the remaining 92% you could examine the incoming characters, store them in a sequence etc. Actually, if you need to handle hardware interrupts at a very high rate, that could be your ultimate downfall - not the port I/O. I like to avoid putting stuff into ex.exe (exw.exe) unless it is used by a lot of programs and performance is critical. I was tempted to add ports before, but there was always something higher up on my wish list. Regards, Rob Craig Rapid Deployment Software