I am ready to use llvm to optimize my Python code. I have read some tutorials but I do not know how to export class objects from Python code to LLVM. How do I create functions in LLVM-PA, but classes are outside my forces.
Here is an example of class I want to make in the LLVM code:
class four (): def __init __ (self, c): self.c = C def next (self, line, p): try: return self.c == except for line [P]: return False def next_rep (self, line, p): try: return self.c == line [ P], except P: Wrong, P I would be grateful for any help!
short answer: you can not
The reason for this is that Python is an interpreted language, and
I recommend that you run your program profile (for example, if you use Linux, the run of iPython -P option, or normally via modules), and find out what is going on in the bulk of program time.
In most programs, a high percentage of the total running time is taken by a relatively small area of code, and by improving it (via Ei algorithm correction or by writing a C extension, for example Through SWIG) can often be in the order of magnitude improvement in performance.
This type of adaptation is usually "everything runs fast".
Comments
Post a Comment