Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] SWT Performance suggestion

Randy,
      I agree, explicit end user locking could be cleaner/easier, I'm sure
it could be given a sufficient enough health warning to make people aware
of the dangers. In my particular case I would still pay 1,000,000 x the JNI
costs.

Paul Anderson
IBM Systems and Technology Group Lab Services
Home Office:+31-20-513-7388, Home Office:+31-70-362-9501,
Mobile:+31-651788098, paul-anderson@xxxxxxxxxx

Try Gentoo Linux (www.gentoo.org)


|---------+------------------------------------>
|         |           Randy Hudson             |
|         |           <hudsonr@xxxxxxxxxx>     |
|         |           Sent by:                 |
|         |           platform-swt-dev-bounces@|
|         |           eclipse.org              |
|         |                                    |
|         |                                    |
|         |           12/28/2006 04:52 PM      |
|         |           Please respond to        |
|         |           "Eclipse Platform SWT    |
|         |           component developers     |
|         |           list."                   |
|---------+------------------------------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                                                  |
  |       To:       "Eclipse Platform SWT component developers list." <platform-swt-dev@xxxxxxxxxxx>                                                 |
  |       cc:                                                                                                                                        |
  |       Subject:  Re: [platform-swt-dev] SWT Performance suggestion                                                                                |
  |                                                                                                                                                  |
  |                                                                                                                                                  |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|



It would be ideal if everyone could benefit from better lock/unlock
strategy without moving to some new API. Perhaps some creative, lazy unlock
approach might help?
Or, maybe adding API GC.lock() and GC.unlock(), and continue using all of
the existing calls?

-Randy




             Paul Anderson
             <paul-anderson@nl
             .ibm.com>                                                  To
             Sent by:                  platform-swt-dev@xxxxxxxxxxx
             platform-swt-dev-                                          cc
             bounces@eclipse.o
             rg                                                    Subject
                                       [platform-swt-dev] SWT Performance
                                       suggestion
             12/28/2006 09:41
             AM


             Please respond to
             "Eclipse Platform
               SWT component
             developers list."
             <platform-swt-dev
               @eclipse.org>







Hi All,
      I'm embarking on creating a graphical tool and have chosen to base it
on SWT, performance will be very important as the display may contain up to
a million lines. In my early experimentation I profiled some code and
noticed that before and after each native call to a graphic primitive such
as _gdk_draw_line there is a Lock.lock and Lock.unlock.

      Would it be possible to add to SWT a new drawing method that allows
me to construct an array of ints that represent a list of drawing
instructions that are sent in there entirety down to the native code for
execution, therefore eliminating the repeated thunking, locks/unlocks and
JNI round trips, there maybe also efficiencies to be had in the native
code. For example:



                  int[] drawList = new int[19];
                  int index=0;

                  drawlist[index++] = SWT.DRAW_LINE;
                  drawlist[index++] = 0;
                  drawlist[index++] = 0;
                  drawlist[index++] = 100;
                  drawlist[index++] = 100;
                  drawlist[index++] = SWT.SET_FOREGROUND;
                  drawlist[index++] = 255;
                  drawlist[index++] = 255;
                  drawlist[index++] = 255;
                  drawlist[index++] = SWT.DRAW_LINE;
                  drawlist[index++] = 0;
                  drawlist[index++] = 100;
                  drawlist[index++] = 100;
                  drawlist[index++] = 0;
                  drawlist[index++] = SWT.DRAW_LINE;
                  drawlist[index++] = 100;
                  drawlist[index++] = 100;
                  drawlist[index++] = 0;
                  drawlist[index++] = 100;


                  GC.drawList(drawList);



Paul Anderson
IBM Systems and Technology Group Lab Services
Home Office:+31-20-513-7388, Home Office:+31-70-362-9501,
Mobile:+31-651788098, paul-anderson@xxxxxxxxxx

Try Gentoo Linux (www.gentoo.org)

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev




Back to the top