Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 112465 - TokenSequence.embedded () is slow
TokenSequence.embedded () is slow
Status: RESOLVED FIXED
Product: editor
Classification: Unclassified
Component: Lexer
6.x
All Windows XP
: P2 (vote)
: 6.x
Assigned To: issues@editor
issues@editor
: PERFORMANCE
: 93534 (view as bug list)
Depends on:
Blocks: 95089
  Show dependency treegraph
 
Reported: 2007-08-09 15:09 UTC by Jan Jancura
Modified: 2007-10-02 13:38 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Jancura 2007-08-09 15:09:53 UTC
TokenSequence.embedded () is very slow.
Comment 1 Miloslav Metelka 2007-08-10 12:21:19 UTC
Yes, we've found this out with Vita when analyzing syntax coloring performance. I have already a change in-progress for
this I just have to finish it.
Comment 2 Miloslav Metelka 2007-08-17 14:05:28 UTC
I have reduced checking for embeddings by only checking result of the first embedding creation for the particular token
id. This should be ok for most cases. If the default behavior needs to be modified the
LanguageHierarchy.embeddingPresence(TokenId) allows to override the default behavior to either always check for an
embedding for each token with the given id (like before this modification) or to disable check for default embedding
completely (suitable e.g. for keywords or operators).
I have added a test for the new behavior.

Checking in src/org/netbeans/lib/lexer/EmbeddingContainer.java;
/cvs/lexer/src/org/netbeans/lib/lexer/EmbeddingContainer.java,v  <--  EmbeddingContainer.java
new revision: 1.9; previous revision: 1.8
done
Checking in src/org/netbeans/lib/lexer/EmbeddedTokenList.java;
/cvs/lexer/src/org/netbeans/lib/lexer/EmbeddedTokenList.java,v  <--  EmbeddedTokenList.java
new revision: 1.9; previous revision: 1.8
done
Checking in src/org/netbeans/lib/lexer/LexerSpiPackageAccessor.java;
/cvs/lexer/src/org/netbeans/lib/lexer/LexerSpiPackageAccessor.java,v  <--  LexerSpiPackageAccessor.java
new revision: 1.8; previous revision: 1.7
done
Checking in src/org/netbeans/lib/lexer/LexerApiPackageAccessor.java;
/cvs/lexer/src/org/netbeans/lib/lexer/LexerApiPackageAccessor.java,v  <--  LexerApiPackageAccessor.java
new revision: 1.7; previous revision: 1.6
done
Checking in src/org/netbeans/lib/lexer/LanguageOperation.java;
/cvs/lexer/src/org/netbeans/lib/lexer/LanguageOperation.java,v  <--  LanguageOperation.java
new revision: 1.9; previous revision: 1.8
done
Checking in src/org/netbeans/lib/lexer/LexerInputOperation.java;
/cvs/lexer/src/org/netbeans/lib/lexer/LexerInputOperation.java,v  <--  LexerInputOperation.java
new revision: 1.8; previous revision: 1.7
done
Checking in src/org/netbeans/lib/lexer/TokenHierarchyOperation.java;
/cvs/lexer/src/org/netbeans/lib/lexer/TokenHierarchyOperation.java,v  <--  TokenHierarchyOperation.java
new revision: 1.17; previous revision: 1.16
done
Checking in src/org/netbeans/lib/lexer/LexerUtilsConstants.java;
/cvs/lexer/src/org/netbeans/lib/lexer/LexerUtilsConstants.java,v  <--  LexerUtilsConstants.java
new revision: 1.15; previous revision: 1.14
done
Checking in src/org/netbeans/spi/lexer/LanguageEmbedding.java;
/cvs/lexer/src/org/netbeans/spi/lexer/LanguageEmbedding.java,v  <--  LanguageEmbedding.java
new revision: 1.8; previous revision: 1.7
done
RCS file: /cvs/lexer/src/org/netbeans/spi/lexer/EmbeddingPresence.java,v
done
Checking in src/org/netbeans/spi/lexer/EmbeddingPresence.java;
/cvs/lexer/src/org/netbeans/spi/lexer/EmbeddingPresence.java,v  <--  EmbeddingPresence.java
initial revision: 1.1
done
Checking in src/org/netbeans/spi/lexer/LanguageHierarchy.java;
/cvs/lexer/src/org/netbeans/spi/lexer/LanguageHierarchy.java,v  <--  LanguageHierarchy.java
new revision: 1.13; previous revision: 1.12
done
Checking in src/org/netbeans/api/lexer/TokenChange.java;
/cvs/lexer/src/org/netbeans/api/lexer/TokenChange.java,v  <--  TokenChange.java
new revision: 1.8; previous revision: 1.7
done
Checking in src/org/netbeans/api/lexer/TokenSequence.java;
/cvs/lexer/src/org/netbeans/api/lexer/TokenSequence.java,v  <--  TokenSequence.java
new revision: 1.12; previous revision: 1.11
done
Checking in src/org/netbeans/api/lexer/Language.java;
/cvs/lexer/src/org/netbeans/api/lexer/Language.java,v  <--  Language.java
new revision: 1.11; previous revision: 1.10
done
Checking in nbproject/project.properties;
/cvs/lexer/nbproject/project.properties,v  <--  project.properties
new revision: 1.14; previous revision: 1.13
done
Checking in test/unit/src/org/netbeans/lib/lexer/EmbeddedTokenListTest.java;
/cvs/lexer/test/unit/src/org/netbeans/lib/lexer/EmbeddedTokenListTest.java,v  <--  EmbeddedTokenListTest.java
new revision: 1.4; previous revision: 1.3
done
Checking in api/apichanges.xml;
/cvs/lexer/api/apichanges.xml,v  <--  apichanges.xml
new revision: 1.20; previous revision: 1.19
done
Checking in src/org/netbeans/lib/lexer/inc/TokenListUpdater.java;
/cvs/lexer/src/org/netbeans/lib/lexer/inc/TokenListUpdater.java,v  <--  TokenListUpdater.java
new revision: 1.16; previous revision: 1.15
done
RCS file: /cvs/lexer/test/unit/src/org/netbeans/lib/lexer/lang/TestEmbeddingTokenId.java,v
done
Checking in test/unit/src/org/netbeans/lib/lexer/lang/TestEmbeddingTokenId.java;
/cvs/lexer/test/unit/src/org/netbeans/lib/lexer/lang/TestEmbeddingTokenId.java,v  <--  TestEmbeddingTokenId.java
initial revision: 1.1
Comment 3 Miloslav Metelka 2007-10-02 13:38:05 UTC
*** Issue 93534 has been marked as a duplicate of this issue. ***


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo