Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing code in Glamour must be faster #799

Closed
seandenigris opened this issue Aug 3, 2015 · 10 comments
Closed

Editing code in Glamour must be faster #799

seandenigris opened this issue Aug 3, 2015 · 10 comments

Comments

@seandenigris
Copy link
Contributor

Originally reported on Google Code with ID 799

Launch the following browser, and then try to type more code. It is dead slow. Using
the same fragment in the workspace is fast. This means that we are probably using the
PluggableTextMorph in a wrong way. The problem appeared since Pharo 1.4.

GLMWrapper new 
    show: [:a | a text ];
    openOn: 'GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.'

Reported by tudor.girba on 2012-05-27 06:59:35

@seandenigris
Copy link
Contributor Author

Reported by estebanlm on 2012-06-03 10:34:45

  • Status changed: Accepted

@seandenigris
Copy link
Contributor Author

Accepted! 

That is a step forward :)

Reported by tudor.girba on 2012-06-03 14:05:07

@seandenigris
Copy link
Contributor Author

Esteban: any news on this front?

Reported by tudor.girba on 2012-07-24 15:12:04

@seandenigris
Copy link
Contributor Author

This is an important bug, and I need help to fix it. Does anyone have time to look into
it?

Reported by tudor@tudorgirba.com on 2012-09-05 13:38:23

  • Labels added: Priority-High
  • Labels removed: Priority-Medium

@seandenigris
Copy link
Contributor Author

yeah, sorry... I've been busy like hell :(

Reported by estebanlm on 2012-09-05 14:22:33

@seandenigris
Copy link
Contributor Author

The simple text editor seems to be ok now. The problem is in the SmalltalkCode

GLMWrapper new 
    show: [:a | a smalltalkCode ];
    openOn: 'GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
GLMWatcherWindow uniqueInstance toggleOpen.
'

Reported by tudor@tudorgirba.com on 2012-10-16 06:14:44

@seandenigris
Copy link
Contributor Author

Observations
- only code, not text. Text stays fast.
- only editing at the end. At the beginning stays fast.
- source code examples in GLMBasicExamples are mostly short enough, so the speed drop
off seems to be very sudden
- speed loss doesn't seem to be exponential or high O, adding much more text just makes
it a bit slower
- adding dots at the end of the text stays fast
- changing GLMSmalltalkCodelModel isCodeCompletionAllowed from true to false eliminates
the lag, but making the text twice as long again reintroduces it
- difference between workspace and browser is: workspace remains responsive, shows
directly the text you're typing, highlighting then happens a second later

Reported by stephan@stack.nl on 2012-11-15 08:48:43

@seandenigris
Copy link
Contributor Author

The problem was that PluggableTextMorph was created with autoAccept: true. This means
that GLMMorphicModel>>accept:notifying: is called on each key stroke which completely
replaces the text, recompiles it and redoes the highlighting twice.

Reported by chisvasileandrei on 2012-11-16 09:27:13

  • Status changed: Fixed

@seandenigris
Copy link
Contributor Author

wow... it was a stupid error (the harder errors to get... )... and I spent like 3 days
(during 3 months, he, trying to understand the style process and why that was happening
:)

Reported by estebanlm on 2012-11-16 10:13:02

@seandenigris
Copy link
Contributor Author

Well, the reason why we had this code in there was so that we can get a hook for getting
announced when the text changes inside the morph. We need this information so that
we can set the text port in the presentation.

So, we fixed the syntax highlighting, but now the text setting is broken.

Reported by tudor@tudorgirba.com on 2012-11-16 10:23:14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant