Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Command performance problem

Command performance problem

Scheduled Pinned Locked Moved WPF
performancehelpquestionannouncement
15 Posts 4 Posters 29 Views 1 Watching
  • 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.
  • S Offline
    S Offline
    Super Lloyd
    wrote on last edited by
    #1

    With a bit of hack we were able to use command to return the current value of the target (as well as IsEnable), so we could nicely update color pickers, etc... on the control tool bar. Now the problem is we use lots of command in our application (about 300). And every time the user key one char in we do heavy processing as well (relayouting and repainting all visual information), and now that we have command, on top of the heavy text processing we've got all command updating (it's the behavior of the input manager to fire up an update of the command sources on key up). So... since we moved to command we suffer huge performance problem due to the above reason. Is there a way to disable command updating for a little while (while typing text) or. In fact, ideally, I would like to disable only some command updating (whereas text command should still update...) Any tip?

    L 2 Replies Last reply
    0
    • S Super Lloyd

      With a bit of hack we were able to use command to return the current value of the target (as well as IsEnable), so we could nicely update color pickers, etc... on the control tool bar. Now the problem is we use lots of command in our application (about 300). And every time the user key one char in we do heavy processing as well (relayouting and repainting all visual information), and now that we have command, on top of the heavy text processing we've got all command updating (it's the behavior of the input manager to fire up an update of the command sources on key up). So... since we moved to command we suffer huge performance problem due to the above reason. Is there a way to disable command updating for a little while (while typing text) or. In fact, ideally, I would like to disable only some command updating (whereas text command should still update...) Any tip?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Lloyd, I'll send Josh Smith an email about this question and see if he has some advice for you. Do you have 300 commands all enabled all the time? Does this problem only happen on one control or one form, or is it application wide? What sort of application is this?

      Cheers, Karl My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

      Just a grain of sand on the worlds beaches.

      S 1 Reply Last reply
      0
      • L Lost User

        Lloyd, I'll send Josh Smith an email about this question and see if he has some advice for you. Do you have 300 commands all enabled all the time? Does this problem only happen on one control or one form, or is it application wide? What sort of application is this?

        Cheers, Karl My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

        Just a grain of sand on the worlds beaches.

        S Offline
        S Offline
        Super Lloyd
        wrote on last edited by
        #3

        well, I'm not really working there anymore but the problem still haunt me!... the application could be found there: http://www.novamind.com/[^] All the button/controls on the ribbon are command source. There are lots of them. Most are enable all the time (although one could argue that invisible control should be disable, I'm not sure about what happen the ribbon control is a 3rd party, anyway some panel have a lot button). What really slow down the app is text imput. The main view is a legacy GDI+ control. The input text box in the view is a custom made text view (not a subclass of TextBoxBas, but of Control with custom text rendering via interop with Uniscribe, but with good perf, as it is able to paste 400k of text rich with the same perf as word). But in NM3 it was already limit, big map slowing the application perceply (as not only we should layout the text, but move all the map's graphics and the autolayouting algorithm is time consuming) Anyway on each key up, all command state is re-evaluate, and although each is relatively quick individually text processing was already putting us down (not only the text control shold do the layout, but we might need to move/relayout all graphics on the map as well...) because of that NM4 using WPF (& commands) is slower than NM3 were that there was no such unnecessary work on key up... is it a bit more clear now?!?

        L 1 Reply Last reply
        0
        • S Super Lloyd

          well, I'm not really working there anymore but the problem still haunt me!... the application could be found there: http://www.novamind.com/[^] All the button/controls on the ribbon are command source. There are lots of them. Most are enable all the time (although one could argue that invisible control should be disable, I'm not sure about what happen the ribbon control is a 3rd party, anyway some panel have a lot button). What really slow down the app is text imput. The main view is a legacy GDI+ control. The input text box in the view is a custom made text view (not a subclass of TextBoxBas, but of Control with custom text rendering via interop with Uniscribe, but with good perf, as it is able to paste 400k of text rich with the same perf as word). But in NM3 it was already limit, big map slowing the application perceply (as not only we should layout the text, but move all the map's graphics and the autolayouting algorithm is time consuming) Anyway on each key up, all command state is re-evaluate, and although each is relatively quick individually text processing was already putting us down (not only the text control shold do the layout, but we might need to move/relayout all graphics on the map as well...) because of that NM4 using WPF (& commands) is slower than NM3 were that there was no such unnecessary work on key up... is it a bit more clear now?!?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Lloyd, Thanks for your response. I've sent Josh an email. Let's see where he takes this. I'm interested in his opinion too.

          Cheers, Karl My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

          Just a grain of sand on the worlds beaches.

          J 1 Reply Last reply
          0
          • L Lost User

            Lloyd, Thanks for your response. I've sent Josh an email. Let's see where he takes this. I'm interested in his opinion too.

            Cheers, Karl My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

            Just a grain of sand on the worlds beaches.

            J Offline
            J Offline
            Josh Smith
            wrote on last edited by
            #5

            Karl...If I want to get involved with a thread, I'll do so on my own.

            :josh: My WPF Blog[^] All of life is just a big rambling blog post.

            L 1 Reply Last reply
            0
            • J Josh Smith

              Karl...If I want to get involved with a thread, I'll do so on my own.

              :josh: My WPF Blog[^] All of life is just a big rambling blog post.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Sorry, :sigh:

              Cheers, Karl My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

              Just a grain of sand on the worlds beaches.

              J 1 Reply Last reply
              0
              • L Lost User

                Sorry, :sigh:

                Cheers, Karl My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

                Just a grain of sand on the worlds beaches.

                J Offline
                J Offline
                Josh Smith
                wrote on last edited by
                #7

                No problem, dude. I just sort of feel obligated to help out once someone mentions that they've asked me to reply to the thread. I'm pretty busy today and don't have time to help out. Damn day job! :-D

                :josh: My WPF Blog[^] All of life is just a big rambling blog post.

                L 1 Reply Last reply
                0
                • J Josh Smith

                  No problem, dude. I just sort of feel obligated to help out once someone mentions that they've asked me to reply to the thread. I'm pretty busy today and don't have time to help out. Damn day job! :-D

                  :josh: My WPF Blog[^] All of life is just a big rambling blog post.

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Maybe in the next couple of days. This question is beyond my skills to answer properly. Have a great day and don't forget, "who loves ya!" :cool:

                  Cheers, Karl My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

                  Just a grain of sand on the worlds beaches.

                  J P 2 Replies Last reply
                  0
                  • L Lost User

                    Maybe in the next couple of days. This question is beyond my skills to answer properly. Have a great day and don't forget, "who loves ya!" :cool:

                    Cheers, Karl My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

                    Just a grain of sand on the worlds beaches.

                    J Offline
                    J Offline
                    Josh Smith
                    wrote on last edited by
                    #9

                    Karl Shifflett wrote:

                    Have a great day and don't forget, "who loves ya!"

                    Jesus? Satan? Captain Crunch?! :~

                    :josh: My WPF Blog[^] All of life is just a big rambling blog post.

                    L 1 Reply Last reply
                    0
                    • J Josh Smith

                      Karl Shifflett wrote:

                      Have a great day and don't forget, "who loves ya!"

                      Jesus? Satan? Captain Crunch?! :~

                      :josh: My WPF Blog[^] All of life is just a big rambling blog post.

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      You forgot Santa and Mole.

                      Cheers, Karl My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

                      Just a grain of sand on the worlds beaches.

                      J 1 Reply Last reply
                      0
                      • L Lost User

                        You forgot Santa and Mole.

                        Cheers, Karl My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

                        Just a grain of sand on the worlds beaches.

                        J Offline
                        J Offline
                        Josh Smith
                        wrote on last edited by
                        #11

                        Good call! Also, Elvis might be on that list.

                        :josh: My WPF Blog[^] All of life is just a big rambling blog post.

                        1 Reply Last reply
                        0
                        • L Lost User

                          Maybe in the next couple of days. This question is beyond my skills to answer properly. Have a great day and don't forget, "who loves ya!" :cool:

                          Cheers, Karl My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

                          Just a grain of sand on the worlds beaches.

                          P Offline
                          P Offline
                          Pete OHanlon
                          wrote on last edited by
                          #12

                          Karl Shifflett wrote:

                          don't forget, "who loves ya!"

                          That's easy. Paris Hilton, Pamela Anderson, Lindsey Lohan and the Josh Stalkerettes.

                          Deja View - the feeling that you've seen this post before.

                          My blog | My articles

                          1 Reply Last reply
                          0
                          • S Super Lloyd

                            With a bit of hack we were able to use command to return the current value of the target (as well as IsEnable), so we could nicely update color pickers, etc... on the control tool bar. Now the problem is we use lots of command in our application (about 300). And every time the user key one char in we do heavy processing as well (relayouting and repainting all visual information), and now that we have command, on top of the heavy text processing we've got all command updating (it's the behavior of the input manager to fire up an update of the command sources on key up). So... since we moved to command we suffer huge performance problem due to the above reason. Is there a way to disable command updating for a little while (while typing text) or. In fact, ideally, I would like to disable only some command updating (whereas text command should still update...) Any tip?

                            L Offline
                            L Offline
                            Lost User
                            wrote on last edited by
                            #13

                            Lloyd, I've just written an article that you can read here. http://karlshifflett.wordpress.com/2008/02/24/wpf-sample-series-wpf-mvc-tabcontrol-mdi-and-commandbindings/[^] I think this will give you some insight into your issues.

                            Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

                            Just a grain of sand on the worlds beaches.

                            S 1 Reply Last reply
                            0
                            • L Lost User

                              Lloyd, I've just written an article that you can read here. http://karlshifflett.wordpress.com/2008/02/24/wpf-sample-series-wpf-mvc-tabcontrol-mdi-and-commandbindings/[^] I think this will give you some insight into your issues.

                              Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

                              Just a grain of sand on the worlds beaches.

                              S Offline
                              S Offline
                              Super Lloyd
                              wrote on last edited by
                              #14

                              Indeed some interesting concept. As I said I'm not working there anymore.. But I was thinking to soon start a pet project were I could test all of that. Will give it a try some day. Thanks for taking some times to think about it hey!

                              L 1 Reply Last reply
                              0
                              • S Super Lloyd

                                Indeed some interesting concept. As I said I'm not working there anymore.. But I was thinking to soon start a pet project were I could test all of that. Will give it a try some day. Thanks for taking some times to think about it hey!

                                L Offline
                                L Offline
                                Lost User
                                wrote on last edited by
                                #15

                                My pleasure to server. True be told, your issue played a major role in my REALLY digging into this. So... Thank you!:cool:

                                Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

                                Just a grain of sand on the worlds beaches.

                                1 Reply Last reply
                                0
                                Reply
                                • Reply as topic
                                Log in to reply
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes


                                • Login

                                • Don't have an account? Register

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • World
                                • Users
                                • Groups