Community
    • Login

    Bookmark multiple lines.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    25 Posts 5 Posters 16.7k 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.
    • Claudia FrankC
      Claudia Frank
      last edited by

      by using direct function pointer it is a little bit faster ;-)

      DirectFunction took 0.111000061035 seconds
      DirectFunction took 0.147000074387 seconds
      DirectFunction took 0.148999929428 seconds
      DirectFunction took 0.146000146866 seconds
      DirectFunction took 0.154000043869 seconds
      DirectFunction took 0.271999835968 seconds
      DirectFunction took 0.24799990654 seconds
      DirectFunction took 0.164999961853 seconds
      DirectFunction took 0.164999961853 seconds
      DirectFunction took 0.171000003815 seconds
      

      Cheers
      Claudia

      1 Reply Last reply Reply Quote 0
      • Claudia FrankC
        Claudia Frank
        last edited by

        and with some performance optimization, same test, same machine,

        DirectFunction took 0.0729999542236 seconds
        DirectFunction took 0.0710000991821 seconds
        DirectFunction took 0.0720000267029 seconds
        DirectFunction took 0.0759999752045 seconds
        DirectFunction took 0.0729999542236 seconds
        DirectFunction took 0.0769999027252 seconds
        DirectFunction took 0.0739998817444 seconds
        DirectFunction took 0.0759999752045 seconds
        DirectFunction took 0.0759999752045 seconds
        DirectFunction took 0.0759999752045 seconds
        

        Enough performance testing from my side :-)
        Still curious why wrapped call is so slow.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 1
        • guy038G
          guy038
          last edited by guy038

          Hello, @dail, @scott-sumner, @claudia-frank, and All,

          Ah, I didn’t think that my slowness’s feeling, regarding that script, would lead to so many posts ;-))

          I realize that I was quite vague, about the results of the test. So I did, again, the test with both :

          • Python v1.0.8.0

          • Lua v0.6.0.0

          installed, in a N++ v7.4.2 local configuration, on a old Win XP SP3 platform, with 1Go of RAM, only !

          The python test script was :

          for line_nbr in range(100, 12400):
              editor.markerAdd(line_nbr, 24)
          

          And the Lua test script was :

          for line_nbr = 100, 12400 do
              editor:MarkerAdd(line_nbr, 24)
          end
          

          Results if applied on a classical .txt file, containing 12436 lines, with size = 613,527 bytes :

          • 1m and 59s for the Python script

          • 0.5s, approximatively, for the Lua script

          Really awesome, isn’t it ?! How to explain such a difference ??


          BTW, Dail, I ran the command, below, in the Lua Console. Not sure, however, that it’s the right syntax !

          dofile("Dail_Bookmark.lua")
          

          Now, Dail, an other problem !

          My first idea, for doing the test, was to install the Lua last version ( 0.7.1.0 ). Unfortunately, when starting N++, I got a tiny window, with the message Unknown exception. After validation, this windows disappeared but the lua plugin was not uploaded ( Quite sure that uploaded is not the right English word but I hope I will be understood ! ) That issue also occurs with the v0.7.0.0 version ! So, the last Lua plugin correct version is v0.6.0.0, on my XP machine.

          Probably, this happens on Win WP platforms, exclusively ? But, dail, it’s not that important. Indeed, Don Ho, seemingly, considers not supporting, soon, Win XP, anymore ! Refer :

          https://notepad-plus-plus.org/community/topic/15003/notepad-7-5-4-release/26

          Nevertheless, thanks, by advance, for any investigation, on that matter !

          Best Regards,

          guy038

          Update :

          I’ve just done the test, twice, again, with the Python script ==> A bit better : 1m and 33s , approximatively !!

          dailD 1 Reply Last reply Reply Quote 1
          • dailD
            dail @guy038
            last edited by

            @guy038

            Some very interesting results for sure, I can’t say much as to why the PythonScript version is so much slower and I am very unfamiliar with the Python/C API. Maybe someone more knowledgeable has some ideas.

            Unfortunately, when starting N++, I got a tiny window, with the message Unknown exception.

            Sorry to hear the newer versions are not working for you, and I agree it is probably related to Windows XP. Between versions 0.6.0 and 0.7.0 I did update to VS2015 and it also uses a newer runtime. Even though it is suppose to be compatible with XP there still seems to be a problem as you have found out. Personally I do not have access to an XP machine any more so any XP related issues will probably go unfixed unless someone submits a pull request fixing them.

            1 Reply Last reply Reply Quote 0
            • Claudia FrankC
              Claudia Frank
              last edited by

              I don’t think file size matters, I did a test with a 100mb file as well as with
              file containing just enough carriage returns -> result is the same.

              I haven’t found out yet why PythonScript(PS) is so slow in this case and it must be
              something how PS handles the wrapped call because when using PS and the
              Direct_Function call then I do get results like this

              DirectFunction took 0.0729999542236 seconds
              DirectFunction took 0.0710000991821 seconds
              DirectFunction took 0.0720000267029 seconds
              DirectFunction took 0.0759999752045 seconds
              DirectFunction took 0.0729999542236 seconds
              DirectFunction took 0.0769999027252 seconds
              DirectFunction took 0.0739998817444 seconds
              DirectFunction took 0.0759999752045 seconds
              DirectFunction took 0.0759999752045 seconds
              DirectFunction took 0.0759999752045 seconds
              

              Cheers
              Claudia

              dailD 1 Reply Last reply Reply Quote 0
              • dailD
                dail @Claudia Frank
                last edited by

                @Claudia-Frank

                I did some poking around…and installed PythonScript (I haven’t used it in years). When I ran some test code, one of the first things I realized is that it is that Scintilla is being redrawn multiple times when using PythonScript. I verified this by catching the SCN_UPDATEUI event in Lua. The LuaScript call generates 1 event, using PythonScript generates numerous events…not always the same amount (normally about 50% of however many bookmarks were added). It probably also generates numerous SCN_MODIFIED events?

                You might try a similar test with PythonScript which doesn’t generate any type of side effect, something simple like SCI_STYLEGETFORE which should be a very fast and simple call.

                Claudia FrankC 2 Replies Last reply Reply Quote 2
                • Claudia FrankC
                  Claudia Frank @dail
                  last edited by

                  @dail

                  thanks for looking into this.
                  I will give it a try and let you know.

                  Cheers
                  Claudia

                  1 Reply Last reply Reply Quote 0
                  • Claudia FrankC
                    Claudia Frank @dail
                    last edited by

                    @dail

                    Good job, I guess that is the area which needs investigation, yes.
                    I tested with synchronous and asynchronous callbacks - result was more or less the same.

                    If I
                    added markers for 30 lines it report one aditional updateui event,
                    adding markers to 290 lines it added 3 additional event
                    adding markers to 3800 lines it added 40 additional events

                    lua reported only 1 event in all cases, the same is true if using Direct_Function call.

                    Cheers
                    Claudia

                    1 Reply Last reply Reply Quote 1
                    • guy038G
                      guy038
                      last edited by

                      Hello, @dail,

                      Did you see that post :

                      https://notepad-plus-plus.org/community/topic/15089/notepad-file-status-auto-detection-not-working/37

                      It seems that @vitaliy-dovgan found out a solution, regarding VS2015 and the auto-detection problem, in XP

                      So, given that information, may be, after few modifications, we could have the Lua v7.0 and Lua v7.1 plugins working nice on XP platforms ? Just an intuition but I hope so !

                      Cheers,

                      guy038

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

                        @guy038

                        Unfortunately I’m not sure if that’s the cause of issues with LuaScript running on XP. I know that the plugin itself doesn’t use that type of function call. I’m not sure if the Lua interpreter does underneath…if so it’s probably not something I care to dig into.

                        1 Reply Last reply Reply Quote 0
                        • Alan KilbornA Alan Kilborn referenced this topic on
                        • Alan KilbornA Alan Kilborn referenced this topic on
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors