Community
    • Login

    How to increase performance on PythonScript macro

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 2.2k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Nolan JorgerN Offline
      Nolan Jorger
      last edited by

      Is there a way to increase macro performance of PythonScript macros? Would turning off screen updates as the macro executes help in this regard?

      I have a daily task of editing a MySQL script file that is generated from a PHPMyAdmin export. The file is 120+ MB / 2.5+ million lines in size.

      I have created a PythonScript macro to do the editing, but the execution takes quite some time to complete. I was thinking that performance might improve if the editor did not have to ‘play’ out the instructions on screen.

      Another thought I had was would it be faster to run the script in a Python environment and just pass the filename in as a parameter.

      Any suggestions would be greatly appreciated.

      1 Reply Last reply Reply Quote 0
      • dailD Offline
        dail
        last edited by

        Would turning off screen updates as the macro executes help in this regard?

        Very likely. Not sure if that is possible with the PythonScript plugin. Since the script runs as a separate thread then the screen has a chance to update.

        Another thought I had was would it be faster to run the script in a Python environment and just pass the filename in as a parameter.

        Most definitely would be faster. By how much? Not sure. But it would likely require you to rewrite the script from scratch since you wouldn’t have any type of access to Notepad++ editing commands (e.g. home, cut, copy, etc).

        An alternative option would be to try out the LuaScript plugin (which is a plugin I wrote). It has a very similar interface like PythonScript and Lua is known for being a very fast scripting language. The script doesn’t run in a background thread so the screen wouldn’t update (although that means the entire Notepad++ application would appear to lock up until the script is complete).

        Depending if the macro isn’t too huge I’d be willing to help you port it to LuaScript. I’d be very interesting to see performance results between the two ;)

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors