• Login
Community
  • Login

How to increase performance on PythonScript macro

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
2 Posts 2 Posters 1.9k Views
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.
  • N
    Nolan Jorger
    last edited by May 4, 2016, 2:44 PM

    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
    • D
      dail
      last edited by May 4, 2016, 2:58 PM

      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
      1 out of 2
      • First post
        1/2
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors