Author Topic: CB editor sluggish with large workspace (Ubuntu CB 13.12 rev 9501 2013-12-25)  (Read 2092 times)

Offline Napoleon

  • Multiple posting newcomer
  • *
  • Posts: 59
[Ubuntu 13.10 CB 13.12 rev 9501 built from source]
[My CPU is a Core 2 Duo 2.5GHz]

I have a workspace consisting of 20 projects that in total contain 200 or so files (maybe more).  In some projects I have files that no longer exist due to revision changes in their code base.

When switching between files in the main editor window, I experience a delay in the order of a second before the cursor appears in the next file.  This is a bit annoying, but doesn't really trouble me as I'm not switching files that often.
However, what IS annoying is that while editing I get lag spikes that at random times.  This happens when I'm just moving the cursor around, say to select text.  Or when Scrolling through the lines with the arrow keys.

This problem does not occur with any other applications or editors (eg gedit) that I use.  And it doesn't occur when I'm working with workspaces that have a small numbers (approx 3) of projects and 20 or so files.

Is this normal with a workspace such as mine?  Is there something I can do about this?

Cheers,
Nap

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5219
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Can you try to "disable" the codecompletion plugin from the plugin manager, and try again?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Napoleon

  • Multiple posting newcomer
  • *
  • Posts: 59
Yep, that looks like it did the trick.
What else I noticed, after I posted, is that it only affects some files.  Which is even stranger.  Thinking it might have something to do with character sets, I tried recreating the same file by copy/paste from gedit but that didn't improve things.
Another possibility is that there was some kind of syntax that was causing the problem, but I'm not sure.  I pasted the code of the file in question below:

Code: [Select]
/*
 *  wb_fsm_state_status.h
 *  gusimplewhiteboard / clfsm
 *
 *  Created by Dimitri Joukoff on 15/10/2014.
 *  Copyright (c) 2013, 2014 Rene Hexel. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above
 *    copyright notice, this list of conditions and the following
 *    disclaimer in the documentation and/or other materials
 *    provided with the distribution.
 *
 * 3. All advertising materials mentioning features or use of this
 *    software must display the following acknowledgement:
 *
 *        This product includes software developed by Rene Hexel.
 *
 * 4. Neither the name of the author nor the names of contributors
 *    may be used to endorse or promote products derived from this
 *    software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * -----------------------------------------------------------------------
 * This program is free software; you can redistribute it and/or
 * modify it under the above terms or under the terms of the GNU
 * General Public License as published by the Free Software Foundation;
 * either version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see http://www.gnu.org/licenses/
 * or write to the Free Software Foundation, Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA  02110-1301, USA.
 *
 */
#ifndef gusimplewhiteboard_wb_fsm_state_status_h
#define gusimplewhiteboard_wb_fsm_state_status_h

#include <gu_util.h>
#include "gusimplewhiteboard.h"

#define STATE_BYTE_SIZE     (sizeof(gu_simple_message))
#define INVALDMACHINE       ~0

#define STATESTATUS_SET_STATE(s, machineID, state)   ((s)->_fsms[machineID] = state)
#define STATESTATUS_GET_STATE(s, machineID)    ((s)->_fsms[machineID])

struct wb_fsm_state_status
{
    ARRAY_PROPERTY(uint8_t, fsms, STATE_BYTE_SIZE)

#ifdef __cplusplus
    wb_fsm_state_status()
    {
        memset(this, INVALDMACHINE, sizeof(*this));
    }
#endif
};

#endif // gusimplewhiteboard_wb_fsm_state_status_h
« Last Edit: October 16, 2014, 06:49:05 am by Napoleon »