Article
· Feb 4, 2023 1m read

Embedded Python for iris-log-viewer

I developed iris-log-viewer on a work laptop using an older version of IRIS. My messages.log file has nearly 10k lines. I noticed it takes a couple of seconds to read messages.log file line by line, import each line into a persistent class, and display messages on my screen. I wonder if Python can speed up the process.

 

I developed EmbeddedPython class. Initially I imported a python script file to read messages.log file in Python. Later I figured out how to write a Python classMethod where I invoke IRIS classMethod to import one line at a time while reading messages.log.

 

I developed irislogreader class where I measure how long it takes to read messages.log file and import it line by line. ClassMethod Test1 utilizes IRIS code. ClassMethod Test2 utilizes Python code.

 

I ran both Test1 and Test2 on iris-log-viewer deployed on a free tier EC2 in AWS. Test2 using Python ran slightly faster than Test1 using IRIS. I plan to run more tests using larger messages.log files.

 

Update 2/5/2023: I tested using a 5 MB messages.log file. I ran into an error documented here:

https://community.intersystems.com/post/error-reading-messageslog-file-u...
 

Does Python read a file faster than IRIS?
Results:
0%
(0 votes)
Python is faster
100%
(1 vote)
IRIS is faster
0%
(0 votes)
No meaningful difference
0%
(0 votes)
Unsure
All votes: 1.
This poll is closed.
Discussion (0)1
Log in or sign up to continue