Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8216847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:16:27+00:00 2026-06-07T12:16:27+00:00

I am willing to use llvm to optimize my python code. I read some

  • 0

I am willing to use llvm to optimize my python code. I read some tutorials but I have not figured out how to, let’s say, export class object from the python code to llvm. I learnt how to create a function in llvm-py, but classes are beyond my forces.

Here is an example of class I want to create in llvm code:

class Char():
    def __init__(self,c):
        self.c=c
    def next(self,line,p):
        try:
            return self.c==line[p]
        except:
            return False
    def next_rep(self,line,p):
        try:
            return self.c==line[p],p
        except:
            return False,p

I would be grateful for any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T12:16:29+00:00Added an answer on June 7, 2026 at 12:16 pm

    Short answer: you can’t.

    The reason is that Python is an interpreted language, and there are several statements in the language that won’t easily lend to static evaluation.

    My suggestion is that you profile your program (for example, if you’re running Linux use IPython’s run -p option, or in general through the cProfile module), and figure out what’s taking the bulk of the program’s time.

    In most programs, a high percentage of the total running time is taken by a relatively small area of code, and improving it (either through an algorithmic improvement or through writing a C extension, for example through SWIG) can often result in an order of magnitude improvement in performance.

    This kind of optimization is usually much more effective than trying to make “everything run faster”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Willing to admit I'm a complete .NET newbie, but I have extensive experience in
I am willing to use the jquery treeview. I have categories and subcategories to
I have this Python code to do this: from struct import pack as _pack
I'm trying to use Graphviz dot (but am willing to use something else) to
I have a website online with just HTML and I am not willing to
I am willing to use Google Analytics to track stats about usage of my
Can anyone find an example of a simple server/client thing? I'm willing to use
I am willing to develop a mobile application. I wish to have something working
Gnuplot experts or anyone who is willing to help me - I have explained
I've inherited some C# code that contains about a thousand lines of source that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.