Performance, Speed Tutorials

Anyone know any good online tutorials that emphasize performance techniques and fine tuning for faster code?

Try this one
http://java.sun.com/docs/books/performance/
This one was really great!!! Anyone know any others?

Similar Messages

  • How to increase performance speed of Photoshop CS6 v13.0.6 with trasformations in LARGE image files (25,000 X 50,000 pixels) on IMac3.4 GHz Intel Core i7, 16 GB memory, Mac OS 10.7.5?   Should I purchase a MacPro?

    I have hundreds of these large image files to process.  I frequently use SKEW, WARP, IMAGE ROTATION features in Photoshop.  I process the files ONE AT A TIME and have only Photoshop running on my IMac.  Most of the time I am watching SLOW progress bars to complete the transformations.
    I have allocated as much memory as I have (about 14GB) exclusively to Photoshop using the performance preferences panel.  Does anyone have a trick for speeding up the processing of these files--or is my only solution to buy a faster Mac--like the new Mac Pro?

    I have hundreds of these large image files to process.  I frequently use SKEW, WARP, IMAGE ROTATION features in Photoshop.  I process the files ONE AT A TIME and have only Photoshop running on my IMac.  Most of the time I am watching SLOW progress bars to complete the transformations.
    I have allocated as much memory as I have (about 14GB) exclusively to Photoshop using the performance preferences panel.  Does anyone have a trick for speeding up the processing of these files--or is my only solution to buy a faster Mac--like the new Mac Pro?

  • Servlet performance speed

    Any advice on how to improve the performance and speed
    of this servlet or any other comments please
    public class LogInServlet extends HttpServlet {
        byte[] header;
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {
            // variables
            ServletOutputStream out;
            Calendar c;
            String day;
            String date;
            String timenow;
            Connection con = null;
            Statement stmt = null;
            ResultSet result = null;
            // setup output
            response.setContentType("text/html");
            out = response.getOutputStream();
            // get inputs
            String pass = (String)request.getParameter("*");
            String namenum = (String)request.getParameter("*")+
            ", "+
            (String)request.getParameter("*")+
            " ("+
            (String)request.getParameter("*")+
            // get current time
            c = Calendar.getInstance();
            try{
                // get db connection
                Context initCtx = new InitialContext();
                Context envCtx = (Context) initCtx.lookup("java:comp/env");
                DataSource ds = (DataSource)envCtx.lookup("jdbc/*");
                con = ds.getConnection();
                stmt = con.createStatement();
                result = stmt.executeQuery("*");
                // check username
                if(result.next()){
                    // check password
                    if(result.getString("*").equals(pass)){
                        // SOLVES LOWERCASE PROBLEM
                        namenum = result.getString("*");
                        day = getDay(c);
                        date = getDate(c);
                        stmt.close();
                        stmt = null;
                        stmt = con.createStatement();
                        result.close();
                        result = null;
                        result = stmt.executeQuery("*");
                        // check if setup to login
                        if(result.next()){
                            // check if logged in already
                            if(!date.equals(result.getString("*"))){
                                stmt.close();
                                stmt = null;
                                stmt = con.createStatement();
                                result.close();
                                result = null;
                                result = stmt.executeQuery("*");
                                result.next();
                                String time = result.getString(day+"_start");
                                timenow = getTime(c);
                                // check if late
                                if(checkIfLate(c,time)){
                                    stmt.close();
                                    stmt = null;
                                    stmt = con.createStatement();
                                    result.close();
                                    result = null;
                                    result = stmt.executeQuery("*");
                                    // check if timeoff booked
                                    if(!result.next()){
                                        // add late record
                                        stmt.close();
                                        stmt = null;
                                        stmt = con.createStatement();
                                        stmt.executeUpdate("*");
                                        // update login
                                        stmt.close();
                                        stmt = null;
                                        stmt = con.createStatement();
                                        stmt.executeUpdate("*");
                                        // complience
                                        stmt.close();
                                        stmt = null;
                                        stmt = con.createStatement();
                                        stmt.executeUpdate("*");
                                        // late
                                        out.write(header);
                                        out.print("</body></html>");
                                        out.close();
                                    else{
                                        // update login
                                        stmt.close();
                                        stmt = null;
                                        stmt = con.createStatement();
                                        stmt.executeUpdate("*");
                                        // complience
                                        stmt.close();
                                        stmt = null;
                                        stmt = con.createStatement();
                                        stmt.executeUpdate("*");
                                        // ok
                                        out.write(header);
                                        out.println("</body></html>");
                                        out.close();
                                else{
                                    // update loging
                                    stmt.close();
                                    stmt = null;
                                    stmt = con.createStatement();
                                    stmt.executeUpdate("*");
                                    // complience
                                    stmt.close();
                                    stmt = null;
                                    stmt = con.createStatement();
                                    stmt.executeUpdate("*");
                                    // ok
                                    out.write(header);
                                    out.println("</body></html>");
                                    out.close();
                            else{
                                out.write(header);
                                // alreadyLoggedIn
                                out.println("</body></html>");
                                out.close();
                        else{
                            out.write(header);
                            // notSetupLogin
                            out.println("</body></html>");
                            out.close();
                    else{
                        out.write(header);
                        // passwordIncorrect
                        out.println("</body></html>");
                        out.close();
                else{
                    out.write(header);
                    // nameIncorrect
                    out.println("</body></html>");
                    out.close();
            catch(Exception e){
                out.write(header);
                out.println("</body></html>");
                out.close();
            finally{
                if(result != null){
                    try{
                        result.close();
                    catch(SQLException e){
                    result = null;
                if(stmt != null){
                    try{
                        stmt.close();
                    catch(SQLException e){
                    stmt = null;
                if(con != null){
                    try{
                        con.close();
                    catch(SQLException e){
                    con = null;
        private boolean checkIfLate(Calendar c,String t){
            StringTokenizer stz = new StringTokenizer(t,":");
            int sh = Integer.parseInt(stz.nextToken());
            int sm = Integer.parseInt(stz.nextToken());
            int ch = c.get(Calendar.HOUR_OF_DAY);
            int cm = c.get(Calendar.MINUTE);
            if(ch > sh)
                return true;
            else if(ch == sh){
                if(cm > sm)
                    return true;
                else
                    return false;
            else
                return false;
        private String getTime(Calendar c){
            int t = c.get(Calendar.MINUTE);
            if(t < 10)
                return c.get(Calendar.HOUR_OF_DAY)+":0"+t;
            else
                return c.get(Calendar.HOUR_OF_DAY)+":"+t;
        private String getFullDay(String d){
            if("mon".equals(d))
                return "Monday";
            else if("tue".equals(d))
                return "Tuesday";
            else if("wed".equals(d))
                return "Wednesday";
            else if("thu".equals(d))
                return "Thursday";
            else if("fri".equals(d))
                return "Friday";
            else
                return "Sunday";
        private String getDay(Calendar c){
            int d1 = c.get(Calendar.DAY_OF_WEEK);
            if(d1 == 2)
                return "mon";
            else if(d1 == 3)
                return "tue";
            else if(d1 == 4)
                return "wed";
            else if(d1 == 5)
                return "thu";
            else if(d1 == 6)
                return "fri";
            else
                return "z";
        private String getDate(Calendar c){
            int dateI1 = c.get(Calendar.MONTH)+1;
            int dateI2 = c.get(Calendar.DAY_OF_MONTH);
            if(dateI1 < 10){
                if(dateI2 < 10)
                    return Integer.toString(c.get(Calendar.YEAR))+
                    "-"+
                    "0"+
                    Integer.toString(dateI1)+
                    "-"+
                    "0"+
                    Integer.toString(dateI2);
                else
                    return Integer.toString(c.get(Calendar.YEAR))+
                    "-"+
                    "0"+
                    Integer.toString(dateI1)+
                    "-"+
                    Integer.toString(dateI2);
            else{
                if(dateI2 < 10)
                    return Integer.toString(c.get(Calendar.YEAR))+
                    "-"+
                    Integer.toString(dateI1)+
                    "-"+
                    "0"+
                    Integer.toString(dateI2);
                else
                    return Integer.toString(c.get(Calendar.YEAR))+
                    "-"+
                    Integer.toString(dateI1)+
                    "-"+
                    Integer.toString(dateI2);
        protected void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException,IOException {
            processRequest(request, response);
        protected void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException,IOException {
            processRequest(request, response);
        public String getServletInfo() {
            return "Short description";
        public void destroy() {
        public void init(ServletConfig config) throws ServletException {
            super.init(config);
            header = "<HTML><HEAD><TITLE>*".getBytes();
    }

    DrClap / AnyOne
    The problem I'm having is that everybody uses this servlet at around the
    same time and this causes the memory usage and cycles to spike and
    halts other application running on the server.
    I was hoping that by speeding up the application,so that people could get
    in and out of the servlet quickly this would reduce the memory usage
    as some people would finish before the next people use it.
    I also wanted to decrease the amount of memory the servlet uses.
    The garbage collection and tomcat are tuned.
    I want to optimise the code so that I can restrict the JVM to use the
    least amount of memory.
    I'm assured the query strings and index's are optimised.
    The code snippet above yielded a 30% increase in execution time
    (this was using a loadtester and thousands of requests on just that piece of code)
    I'm going to give preparedstatements a try to see if it changes speed
    (the data is cleaned using javascript on the clientside)
    Questions / Comments
    Connection Pooling:
    Not if you used a connection pool, which you should be doing anyway. And if you're putting all your code >>in one giant class just to avoid creating an object, you're doing the wrong thing.That is exactly why I put the code in the one servlet.
    If I set the max connections number to the maximum number of users
    and by putting all the code in one servlet each user will use only one connection:
    1. therefore there will be no one waiting for a connection to become available (increases speed)
    2. the less connections created the less memory used
    Is this thinking correct?????
    Servlet HTML vs JSP
    I know it is correct design to keep the view away from business logic
    but
    1. Is it quicker and less memory hungry to use ServletOutputStream to print html
    or requestDispatcher to jsp?????
    }

  • Real world performance/speed difference between 3ghz and 3.2

    Hello,
    I have a 2008, (not clovertown) Harpertown 3.0ghz Mac Pro. I wanted to know if its feasible to upgrade the cpus to the 3.2 ones? Also, what is the REAL WORLD speed/performance difference between the 3.0 and 3.2? I am so stressed out over this that I really need to have an answer to this.
    Not that I am going to buy the 3.2 processors, just wanting to see what I am missing here in terms of percentage overall between my mac pro and a 3.2ghz mac pro from 2008.
    Thank you,

    You realize that by now you can probably guess what some of our answers might be?
    Real world... well, in the real world you drive to work stuck in traffic most of the time, too.
    Spend your money on a couple new solid state drives.
    You want this for intellectual curiosity, so look at your Geekbench versus others.

  • What is the impact of using a variant data type on performance, speed memory demands etc?

    This is another one of my "lets get this settled once and for all" threads.
    I have avoided variant data types whenever possible to keep the performance of my apps up. From some observatsions i have made over the years, I am of the opinion that;
    1) In-place operations can not be carried out on variants.
    2) Passing a variant to a sub-VI (regardless of the terminal on the icon connector) are always copied.
    I would like confirmation or correction of the above so we know more about this animal we call LabVIEW.
    Thank you,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Solved!
    Go to Solution.

    A couple notes:
    1. You can use the To/From Variant nodes for the Inplace Element Structure to operate inplace on the contained variant data. This should work just fine even if you have a big 2D array contained.
    2. Variants are incredibly useful when you use them for Variant Attributes, rather than just storing data. The Variant Attribute implementation uses a binary tree to store the key value pairs, which provides quick insertion and lookup.
    3. I don't work on the internals of LV, but I see no reason whatsoever that passing a variant into a subVI would always necessitate a copy. I could be wrong, but that sounds very odd to me.
    However, I have generally started trending towards using flattened strings. Flattened strings are generally more efficient memory-wise, because they don't contain all the type descriptor information, just the raw data. (I think there's some exception when flattening LV Classes.) Variants always store the type descriptor, so even an empty variant can take up a bit of memory.
    Variants received a big performance boost from 7.x to 8.x. They used to have a bad reputation, but I wouldn't be afraid to use them where applicable. I personally don't see a lot of benefits over flattened strings, though, except in the case of tools like the OpenG Variant INI files, which can dynamically parse out and construct variant types.
    Jarrod S.
    National Instruments

  • Performance speeds Tiger vs. Leopard

    I know others have asked but they did not get any in depth answer.
    http://discussions.apple.com/thread.jspa?threadID=2718028
    I have a 1.25 Emac, with 1Gb RAM. Tiger runs fine and all, minus flash video, but the upgrade path on the software end is starting to dwindle. (for instance iTunes)
    With the same hardware set up how much of a performance change would I see running X.5?
    I have heard conflicting stories. And if I bumped it up to 1.5GB would the performance increase be notable.

    Years ago there was a work around for turning off Quartz Extreme on older versions of OSX
    I believe you are thinking of another QE issue. QE was not supported for PCI video cards like in the G3 minitowers and the first G4s. QE would, by default only work with an AGP video card. There was a hack to change QE support from AGP to a PCI card. It worked but w could cause other PCI cards to stop working.
    Having uses a PCI G3 lacking QE support for years, trust me when I say you do NOT want it turned off. 2D actions like scrolling and dragging are miserable.
    I agree with the wise Hobo--Dashboard remains running in the background once you activate it. Widgets that have to "phone home" regularly (site monitoring widgets; web cam widgets; some weather widgets) can eat a lot of resources. YOu can either completely disable Dashboard or, what I did: get the amazingly useful widget DashQuit:
    http://www.apple.com/downloads/dashboard/status/dashquit_berenguierduncan.html
    It lets you use Dashboard and then turn it off with a click. Very nice to have. Lets you get the benefit from widgets without paying the performance price when you are done widgeting.
    I don't consider Spotlight a big resource hog except when you first upgrade the system. I upgraded my G4 tower from 10.4 to 10.5 last evening and the initial Spotlight indexing ran for several hours. Now it's finished and things are back to normal. With normal computing patterns, Spotlight will run only for short intervals. The only times I had it seem obvious after the initial indexing was when I moved a larger number of files from a backup drive to my boot volume.

  • Is Using Static functions advisable from performance(speed) point of view

    I was wondering if using a static function would be slower than using a normal function, especially when the function is to be accessed by multiple threads since the same memory area is used each time the static function is accessed from any of the threads. Thus is it right if I say that static functions are not suitable for multiThreaded access ?

    I was wondering if using a static function would be
    slower than using a normal function,Static functions are linked at compile time, while normal functions have to be linked based on the runtime type of the object they are called on. This lookup means that static function invocations are likely to be faster.
    especially when
    the function is to be accessed by multiple threads
    since the same memory area is used each time the
    static function is accessed from any of the threads.If you are talking about the code segment, where the function definition is held, there is only a single copy of each "normal" function as well. The code segment is also read-only, so there are no issues with multiple threads reading and executing the same code at the same time.
    There are the normal issues with multi-threaded access to variables in static functions that exist with normal functions.
    Thus is it right if I say that static functions are
    not suitable for multiThreaded access ?Static functions are no safer than non-static functions in terms of thread safety. On the other hand, it is no more dangerous having multiple threads calling a static function than having multiple threads calling a non-static function on the same object. Exactly the same thread safety techniques apply whether you are working in a static or a non-static context.
    With the above in mind, there is a great deal of design difference between static functions and non-static functions. They mean very different things when creating a system, and an operation that is suited for a static function is very likely not appropriate in a non-static context, and vice versa. The important thing is to make sure the design is appropriate for what the system is trying to do.
    The most common use of static functions is for object creation... The Factory design pattern uses static methods to create objects of a given type, the Singleton design pattern uses static methods to allow access to itself.

  • Poor Performance after start up and Frequent Crashes

    I have a brand new imac i order a little over 6 months ago, i immediately migrated my old imac's files to the new mac and everything worked great but then slowly began to degrade in performance and now i have nothing but problems that have gotten worse.
    The first problem occurred with a slow performance speed after about a month of amazing performance.
    Then I noticed the new magic mouse i had ordered with the computer would lose connection with the computer causing it to crash, also the new mouse would not hold a charge for long. My last magic mouse did not have this issue.
    My computer would fall asleep and then i could be unable to wake it by using my mouse, even plugging in an apple pro wired mouse would not work, i had to turn the power on and off to restart
    My bluetooth was acting funny trying to connect to devices i hadn't authorized
    Then came a kernel crash.
    Then came apple 3 tired support who after weeks of diagnosis over the phone were stumped.
    I tried the following to fix the problems myself:
    reset the Pram
    Repaired Disk Permissions
    Checked the hardware
    reinstalled the OS
    Checked for and installed all software updates
    Reset the SMC
    Ran 3rd party software "mackeeper" to optimize my files and check for viruses
    Clean up unneeded files so plenty of memory
    And finally downloaded a 3rd part program called "idrefrag" to defrag my system files.
    nothing worked
    I was unable to take additional time to deal with the issue, i work and attend school online and was extremely busy during the summer so i had to just deal with the issues because being without my computer was not an option i had.
    After my busy summer ended, the problems had only gotten worse
    Now, not only does the mac fall asleep and not wake up and not respond to the magic mouse to wake up or reconnect when the mouse and mac lose signal, but now when i plug in a usb flash drive to my external flash drive port, it's like playing russian roulette, half the time it's fine, the other half the computer freeze upon insertion of the drive. I shouldn't have so much anxiety plugging in a 8gb flash drive.
    but now on to the worst part, before the summer when i had to restart after crashes it was normal, but now when i restart, the computer acts like it has to remember how to even be a computer again. Upon restarting after the classic Mac tone:
    My mac desktop begins to reload, although the icons on the top right appear then disappear and then appear to load back up very slowly.
    Moving files to another folder or tp the trash is painstakingly slow, i get a message saying "preparing to move file" that goes on for 10 minutes.
    Simple tasks like trying to copy and paste or access my "places" on the side bar like "movies, "Pictures" etc cause a pinwheel and then each "place" has to load all the files as if it's searching the computer for them all before i have access to them, this can take 5-10 minutes
    When i click on an application from the dock to load, it just bounces for a while and then finally starts up but takes 5 minutes or more to be able to access without a pinwheel
    Overall the computer basically forgets how to be a computer and has to relearn how to do the simplest tasks, the next 24 hours is plagued by pinwheels and slow performance and then it acts fine again, but i can never shut it down or it start all over again, so i just let it fall asleep when not in use and cross my fingers that when i come back it will respond to the mouse and wake up, half the time it does, the other half, i have to restart by holding the power button down and then pressing it to start up again.
    I had to just adapt, so i have a good system down now and so when I restart i run the system disk utility and repair the HD 1 & 2 's permission which always seems to have a lot of issues and that kinda helps speed along the 24 hour relearning process. But i shouldn't have to do all this stuff, i spent 3,000 on this computer, i bought all the upgrades and after a couple of months of amazing performance i was left with a time bomb and 3 tier apple support who have no idea where to go and now wont even call me back despite my paying for 4 years of apple care, I am at a total loss of what to do, i can't afford to send the machine off for diagnosis and repair and frankly think Apple should send me a new machine since not only does the mac itself present problems, but so does the new magic mouse, and the rechargeable batteries and charger i purchased from them as well.
    My Mac info:
    Mac OS X Version 10.6.8
    Model Name:          iMacModel Identifier:          iMac12,1
    Processor Name:          Intel Core i7
    Processor Speed:          2.8 GHz
    Number of Processors:          1
    Total Number of Cores:          4
    L2 Cache (per Core):          256 KB
    L3 Cache:          8 MB
    Memory:          16 GB
    Serial -ATA
    any suggestions?

    Thats a shame, you should be enjoying your mac!, what was the final outcome of the Apple support guys?. I think if it were me and i had tried tried everything that you have including the support tech. i would be pressing for a replacement mac.

  • I am desperate!! slow choppy network speeds (not actual inability to cnnct)

    I have a 13" macbook air that has the following problem: I can connect to wifi networks (including at home WPA and also tried WPA2 settings) but even though I may get proper speed at first, I soon lose that and it becomes much slower and choppy (if I open activity monitor I can see the speed going up and down like crazy...). My internet speed at home is 12mpbs set by my provider. When I perform speed tests (vis speedtest.net or downloading files from other speed test sites) on my windows PC that is also on this network I get the full download speed. However with this MAC while I initially did get the full speed, it is now down to an average of 3-5mbps and the activity monitor, again, shows choppy behavior so it will be at 8 then at zero almost and then up and down again but never near the full speed. I tried to connect to other networks and I have the same problem - once this happens it stays. I tried removing the airport connection in network preferences and adding it again it does not help.
    I TALKED TO APPLE AND HAD MY COMPUTER TESTED BY THEM - they didn't find any hardware issues (they said it was fine - but it isn't) but they still replaced the airport hardware in the computer - both the chip and the antenna (which meant replacing the entire screen). I brought the computer home, ran a speed test and everything was fine. I thought GREAT but then something happened and the problem returned. What I did (which I think was unrelated) was connect via SMB to a PC at home and I tried to stream a movie file. I noticed it kept 'pausing' so I opened up activity monitor again and to my HORROR I saw the choppy wave with network speed very inconsistent going up and down like crazy... I tried connecting to my slingox using the sling web access after disconnecting from my home PC but got partial speed and lots of drops too. I tried the speed test again multiple times, nothing seems to work.
    SO I don't know what to do at this point. I have 10.6.6 running. I heard something about a firmware update but I am new to mac so not sure how to even do that or what else I can do to solve this problem or what is causing it. BTW - logging in now from the guest account still does not fix the issues and they remain the same.
    I am desperately looking for help!!
    Thanks a lot!

    Have you been able to reproduce your problems on other wireless networks other than at your house? It appears you are saying that this occurs on all wireless, but I'm not sure from your comment. If it's only at home, it would appear to be a compatibility issue between your wireless access point and the Macbook Air, which isn't uncommon. Sometimes a firmware upgrade to the access point can fix it, sometimes it might require switching to a different brand of access point. It would be great if you could borrow (or buy and return) a different access point/router to test. An Apple airport would be the best to use of course. Not the easiest solution, but lets you help rule out a hardware issue with your air.
    My isp provides 15mbps but my wireless devices such as my iphone, ipad, laptop usually only get 6.5-8 mbps when testing speeds to the internet. I don't expect it to be as good as the wired due to interference, signal, etc. I don't get the choppy behavior however. Firware updates from Apple will appear in the same manner as standard software updates. If there is one available for your system it should appear when you check for software updates. That being said, I believe you can also manually download them from the Apple site.

  • How is the processing speed while using struts,spring,and JSF framework

    Hi friends,
    As per earlier technology like Servlets,I mean that there would have much more performance speed than other new technologies like JSP,struts,spring and hibernate framework.Because,in new technologies,flow of processings implicitly via MVC2 basis will probably much more time than older one.
    Total goal is only for attaining MVC2 or any other purpose?
    Please clarify my doubt?
    With Regards,
    Stalin.G

    Home grown applications have a problem in that as more and more features are added, it becomes increasingly impossible to maintain the application and enhance it. This is especially true when the original programmers leave the company. A framework provides a standard design approach that other programmers can hopefully more easily pick up.
    A lot of work has gone into creating these frameworks and they have been used in web sites that have millions of hits from users per day. They have high preformance. Of course, programmers can still write bad code in them that slows down the system. I believe anyone using these frameworks should study them well before using them (such as reading books on them).

  • What most affects Flash performance?

    What components, hardware and software, affect Flash
    performance the most?
    I believe that video cards have no bearing, but have
    recently come into a debate over the RAM vs processor.
    Also, on Windows XP, any tricks to bring up performance
    speed?
    Thanks in advance,
    michael

    Do you mean in reference to authoring or the player?
    Dan Smith > adobe community expert
    Flash Helps >
    http://www.smithmediafusion.com/blog/?cat=11
    http://www.dsmith.tv
    "msimmons55" <[email protected]> wrote in
    message
    news:fs8fd5$nvi$[email protected]..
    > What components, hardware and software, affect Flash
    performance the most?
    >
    > I believe that video cards have no bearing, but have
    recently come into a
    > debate over the RAM vs processor.
    >
    > Also, on Windows XP, any tricks to bring up performance
    speed?
    >
    > Thanks in advance,
    > michael
    >

  • Optimizing Performance

    I am having a problem with my program as I am not getting the
    desired frame rate due to all the code that is getting executed per
    tick. So I have some questions about director and lingo as to which
    way actually executes faster.
    1. Multiple
    ExitFrame calls vs a single
    ExitFrame call.
    I have alot of sprites in my app. Almost all of them have an
    ExitFrame handler.
    Question: is it faster to have each sprite handle it's own
    ExitFrame routine and do code specific to that sprite or is
    it faster to have one generic
    ExitFrame to loop through and execute code for each sprite?
    2. Puppeted sprites vs Non-Puppeted sprites.
    I have a alot of sprites in my program. To make life ALOT
    easier, I simply allocated a good chunk of sprite channels to sole
    use of "dynamically created sprites". My program can have hunders
    of puppeted sprites from any given moment to the next.
    Question: Does director progress faster or slower depending
    on if a sprite is puppeted or not? Or is there any difference at
    all?
    3. Checking to see if a variable is set before setting it.
    I have only recently come into the Director/Lingo world of
    programming. I am originally a VB programmer for almost a decade.
    In visual basic, I have noticed that the code executes faster if
    you don't do unneeded variable assignments by checking to see if it
    was already set.
    Example: In visual basic, let's say you have an array of 1000
    elements, some elements are already set, some are not.
    for i = 1 to 1000
    var(i) = i
    next
    The above code executes fast, but if you are doing that very
    very often, it can be a bottle neck.
    the below code, while doing the exact same thing, actually is
    faster.
    for i = 1 to 1000
    if var(i) <> i then var(i) = i
    next
    In VB, it's faster to do a check of a variable than it is to
    do the assignment when it's not needed. Now granted, this is a poor
    example, usually I am dealing with much more complex routines, but
    the basic principle of what I am trying to get across is the same.
    Question: in Director/lingo, would it speed up the execution
    of code to do a variable check before the assignment, or is the
    very act of adding the check going to slow the down the execution?
    Anyone have any ideas about these? Or anyone have any other
    tips about stupid little things to speed up execution of
    code?

    >
    1. Multiple
    ExitFrame calls vs a single
    ExitFrame
    > call.
    You should consider dropping the exitframe approach, in favor
    of an oop
    model.
    OOP is not faster, as a dual core processor is not faster
    than a single core
    one running at double the speed. In fact, the second should
    be faster, since
    there is no synchronization penalty. However, it is much
    smoother. Same with
    oop, you have a penalty, since you are using more objects,
    but the objects
    can be smart enough to adjust the number of instructions they
    execute as
    required.
    If you e.g. have objects whose coordinates can be calculated
    and stored
    inside the object, you don't have to update the stage each
    time an object
    moves. You can do that once, for all objects in set
    intervals. Long as the
    interval is large enough to handle all intermediate
    processing and
    updatestage cost, you'll have a very smooth movie.
    >
    2. Puppeted sprites vs Non-Puppeted sprites.
    Puppeting does not affect performance -or at least it
    shouldn't. The number
    of sprites, and number of behaviors attached to each sprite
    does. However,
    even when there is a very large number of sprites active, the
    procedure
    should be a joke for any modern cpu. What does cost, is
    redrawing the
    sprites. So, if it's image sprites we are talking about, you
    should perhaps
    consider a single bitmap member you should use as a buffer,
    and imaging
    lingo for drawing each frame. The mouse click events can be
    evaluated by
    keeping a list of virtual sprite positions. Even if not
    familiar with the
    above, the time you'll invest in learning what is required,
    will be rewarded
    with a significant -up to times x- performance increase.
    >
    3. Checking to see if a variable is set before setting it.
    You can create a simple lingo benchmarking script to get your
    answers. As a
    general principle, the less commands the faster. Though not
    really into VB
    (I find c++ and lingo to be a killer combination), I can
    assume why this is
    happening: when setting a variable, vb is executing some code
    to evaluate
    what the value was, and what -if anything- has to be
    released. Though
    nowhere documented, it seems that several years ago, someone
    in the director
    dev team was smart enough to take this matter into account
    when creating the
    object that is known as a lingo variable (64bit internally,
    btw). So,
    director doesn't suffer slow variable release - releasing
    what shouldn't be
    released that is.
    > Anyone have any ideas about these? Or anyone have any
    other tips about
    > stupid
    > little things to speed up execution of code?
    You know, a few years ago, lingo performance/speeding up
    director was a
    regular discussion issue in this list. This is not the case
    anymore. And
    though I can guess a couple reasons why, I found none to be
    qualified as an
    explanation.. Not in my book at least. Case you have any more
    questions, I'd
    be happy to answer. Building a site with director performance
    hints /
    optimizing lingo code is high in my to do list.
    "DaveGallant" <[email protected]> wrote in
    message
    news:[email protected]...
    >I am having a problem with my program as I am not getting
    the desired frame
    > rate due to all the code that is getting executed per
    tick. So I have some
    > questions about director and lingo as to which way
    actually executes
    > faster.
    >
    >
    1. Multiple
    ExitFrame calls vs a single
    ExitFrame
    > call.
    >
    > I have alot of sprites in my app. Almost all of them
    have an
    >
    ExitFrame
    > handler.
    > Question: is it faster to have each sprite handle it's
    own
    >
    ExitFrame
    > routine and do code specific to that sprite or is it
    faster to have one
    > generic
    >
    ExitFrame to loop through and execute code for each sprite?
    >
    >
    2. Puppeted sprites vs Non-Puppeted sprites.
    >
    > I have a alot of sprites in my program. To make life
    ALOT easier, I simply
    > allocated a good chunk of sprite channels to sole use of
    "dynamically
    > created
    > sprites". My program can have hunders of puppeted
    sprites from any given
    > moment
    > to the next.
    > Question: Does director progress faster or slower
    depending on if a sprite
    > is
    > puppeted or not? Or is there any difference at all?
    >
    >
    3. Checking to see if a variable is set before setting it.
    >
    > I have only recently come into the Director/Lingo world
    of programming. I
    > am
    > originally a VB programmer for almost a decade. In
    visual basic, I have
    > noticed
    > that the code executes faster if you don't do unneeded
    variable
    > assignments by
    > checking to see if it was already set.
    >
    > Example: In visual basic, let's say you have an array of
    1000 elements,
    > some
    > elements are already set, some are not.
    >
    > for i = 1 to 1000
    > var(i) = i
    > next
    >
    > The above code executes fast, but if you are doing that
    very very often,
    > it
    > can be a bottle neck.
    > the below code, while doing the exact same thing,
    actually is faster.
    >
    > for i = 1 to 1000
    > if var(i) <> i then var(i) = i
    > next
    >
    > In VB, it's faster to do a check of a variable than it
    is to do the
    > assignment
    > when it's not needed. Now granted, this is a poor
    example, usually I am
    > dealing
    > with much more complex routines, but the basic principle
    of what I am
    > trying to
    > get across is the same.
    >
    > Question: in Director/lingo, would it speed up the
    execution of code to do
    > a
    > variable check before the assignment, or is the very act
    of adding the
    > check
    > going to slow the down the execution?
    >
    >
    >
    > Anyone have any ideas about these? Or anyone have any
    other tips about
    > stupid
    > little things to speed up execution of code?
    >

  • Speed, Cache and Cookies

    I've been trying to figure out why the speed tests at
    http://www.speakeasy.net/speedtest/
    gave me results significantly lower than the advertised speed from my ISP. When I was on the phone with support the guy told me to empty my safari cache and clear all cookies. Sure enough.. before emptying the cache and clearing cookies I got a download speed of 2500 kbps After emptying the cache it was closer to 14500 kbps
    Has anyone else experienced this or understand why emptying the cache would change things so significantly?
    Is a full cache throttling performance/speed somehow?
    Any insight would be appreciated.
    Thanks,
    Bruce
    MacBook Pro   Mac OS X (10.4.6)  

    Download or Upload speed is also going to be affected by overall cable or telephone line usage, something you have no control over. For example, you may experience better speeds late in the evening versus the middle of the day.
    Using broadband, there is no need for Safari's cache file. You can deactivate it either by:
    Using Safari Enhancer
    or -
    Go to the Safari Cache folder located at ~/Library/Cache/Safari. There you can trash the contents:
    - click on the folder in column view,
    - highlight the next column components (cmd. A),
    - then cmd. delete to move to trash).
    - Do not trash the Safari folder.
    To deactivate cache -
    Single click on the Safari cache folder and Cmd I.
    - The info panel for the folder will appear
    - Uncheck the "lock" box.
    - Go to the bottom (ownership). Click on the small triangle (details),
    - Go to "owner" and change the permission to "read only".
    - Next, click on the lock next to owner, and recheck the lock box.
    This will effectively keep the OS from writing new entries to the cache folder.
    Cookies are another matter, as some are important to keep (retain password information, or are required for site access (eg CC or Banks) while others are unnecessary.
    I have found SafariPlus to be a great way to easily manage cookies in Safari. You can indicate "favorites", which facilitates the removal of any non-favorite cookies. The alternative is to manage cookies via Safari's preference>security panel, which in my opinion is a time-consuming task.
    iMac G5 Rev C 20" 2.5gb RAM 250 gb HD/iBook G4 1.33 ghz 1.5gb RAM 40 gb HD   Mac OS X (10.4.6)   LaCie 160gb d2 HD Canon i960 printer

  • No problem, just curious abt performance

    I'm using Lightroom on a Toshiba Satellite A75 with a P4, 3.2Ghtz CPU with 1.2 gig of RAM running XP Home, and Lightroom runs just fine even when I've got PSE5, ACDSee V8, ACDSee fotoSlate, and occasionally Outlook 2003 running at the same time. Yes, SOME functions do slow down some times, but overall, it isn't significantly slower than any other product that claims to compete with LR. And let's face it, my set up is definitely NOT state of the art at this point.
    YET, People with what sound like much more powerful systems complain about LR performance. And people with systems that sound pretty much like mine also complain about performance. But at the same time, other people that fit the above descriptions also feel performance is just fine. It seems there is no consistent pattern regarding performance issues.
    What is going on here? It can't be just a perception issue of some people, can it? I'm not known as a particularly patient guy, so I would think I'm very likely to whine about performance if I thought I wasn't getting full performance out of LR.
    Why is performance satisfaction/dissatisfaction all over the place?

    Virtually every installation has some unique attributes--from software to configuration. Discovering where a conflict or bottleneck takes place is both and art and a science, and it has to be practiced one case at a tiem by individual users in cases where there is such incosnistency as in LR performance speed.
    One good thing about trying to find the hangup on your configuration is that you will learn a great deal about computers, especially your own. Yes, that is doing it the hard way in one sense, but in many cases that is all you can do--and in the end you still may not be successful.
    If it were me, I'd use Occam's Razor and start by putting it on by itself on a dual boot partition--no internet, no virus checkers, nothing--and then add applications one at a time to find what bogs it down. I have a copy LR on my main boot setup, and separately with CS3, a couple of image utilities, and a DAM, put on one at a time and tested after each new addition.
    It runs 30-35% faster in that lean carefully controlled environment. Do I know why it is so much slower in the ebvironment where I have virus, malware, spyware,word processing, accounting, internet and mail,etc,etc,etc applications--not a clue! But, then again, I am not in the slightest surprised that it has been affected by something in that jumble of diverse applications.
    No amount of testing by any software team at Adobe or anywhere else would be able to find all the interactive problems that can potentially occur in today's extraordinarily diverse, complex (and rich) computing enviroments--especially on PCs.
    I think you will note that the number of issues with LR from the Mac side are far fewer, and the general level of expressed satisfaction much higher. That, however, will not get me to buy a Mac :)
    I have a number of serious complaints about LR, but relative speed isn't one of them.

  • Performance of ImageIO.read with jpeg files

    Hi all... I'm pulling my hair out trying to get a seemingly trivial task to work fast in Java. I'm trying to read in a set of jpeg files, and all I really want out of the files (for now) is width and height. The code I'm testing is:
    for(int i = 0; i < fileList.length; i++)
    ImageInputStream iis = ImageIO.createImageInputStream(fileList);
    BufferedImage bi = ImageIO.read(iis);
    The size of the files I'm trying to read varies from between 80k and 150k. Now get this... here's a real shocker for all you jdk1.4.0 fans out there... the ImageIO.read() method takes as long as 4 seconds to read each file! I've got the standard, plain vanilla jdk1.4.0 running on Redhat 7.1, so I'm wondering if this is an issue with the native code method com.sun.imageio.plugins.jpeg.JPEGImageReader.readImage(). The reason I think this is the case is two-fold: 1) I ran -Xrunhprof on this app, and a full 20% of the cpu time is spent in that method. Another 15% is spent in sun.awt.color.CMM.cmmColorConvert(). 2) The same code ran against a directory filled with GIF files runs blazingly fast... the first image decoded takes a second or so, but the next few take milliseconds to decode.
    Is there some optimized native code jpeg readers that I perhaps didn't download? The documentation on this site, to put it bluntly, SUCKS. It's impossible to find any information without resorting to multiple searches, so I highly doubt that I've actually installed everything I should have just by downloading the one installation file for linux. (not the RPM, the one that lets you put it where you want to).
    Any hints or outright solutions to getting jpeg files to be read any faster than this? This shouldn't be rocket science... Every application I've ever seen on any platform up until now can run circles around my pitiful 2 lines of code.
    Thanks for your help!

    you see....I use the ImageReader.readAll(pageIndex, defReadParam) to read from page 'm' to 'n'. The overall performance (speed) is ok. But, the thing is, the thing pauses for some 15 secs approx to read the first page. Then on, it is QUITE fast. Now, if I need to read 500 pages, then the efficiency will be good. But for a single page? The 15 secs is be too long. Anyway I am trying to read a tiff file (which is not too resolute). Guess the first call does smells the ecnoding format to prepare for decoding, etc...But what I want to know is, is there a way to bring down this time. If not, is there any other way to read a tiff page more efficiently? Actually I need to read some pages & write them to a stream...thats all.

Maybe you are looking for

  • "Download Files"procedure not working in duplicate app/shows page not found

    Hello, I have created an application using the "Download files" procedure described in "How to Upload and Download Files in an Application" chapter of the APEX "Advanced Tutorials." It works just fine on the one server, however, when I exported the a

  • SQL Express Edition, Reporting Services Role SCCM 2012

    hi, Question: Can I Use SQL Server 2012 Express Edition to configure Reporting Services Role on SCCM 2012 ? Thanks,

  • MRRL GR-based invoice verification not active error

    Hi, I have a vendor that has ERS active. Before it was activated four POs were raised, goods receipted and invoiced.  All 4 POs have freight charges (for the same vendor) When I run MRRL with "Settle goods items and planned delivery costs", which I h

  • Sum calculated rows and columns

    I have written a SQL report to count the number of offenses by levels of disciplinary actions.  Now I want to total the counts for the rows and columns.  How do I do this? Below is my code.  It produces column headings with counts.  Ie. Offense Descr

  • Won't accept my birth date.

    When I try to buy new songs in iTunes, it want me to upgrade my security. It wants me to do so by having three security questions, an extra e-mail address, and my date of birth. Now the security questions go fine, and so does the e-mail address, but