Skip to content

Release-1.5: Add a common, dense, format for classification operations to lower cost of processing on the host side. #2981

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

Merged
merged 6 commits into from
May 1, 2015

Conversation

CyrusNajmabadi
Copy link
Contributor

This is the work to port this change to release-1.5

Add a common, dense, format for classification operations to lower cost of processing on the host side.

We now just return an array of triples to represent classified results. The triple contains:

  1. the start of the classification.
  2. the length of the classification.
  3. the type of the clasification.

We also encode this into a comma separated string when passing over to the managed side
(as opposed to an JSON array). That way we don't pay such a high JSON parsing cost.
Instead, we can just do a string.split(",") on the encoded triples and process each
element ourselves.
The existing APIs remain for back-compat. But they will be removed in the future once all clients have moved to the new API.

…st of processing on the host side.

We now just return an array of triples to represent classified results.  The triple contains:
1) the start of the classification.
2) the length of the classification.
3) the type of the clasification.

We also encode this into a comma separated string when passing over to the managed side
(as opposed to an JSON array).  That way we don't pay such a high JSON parsing cost.
Instead, we can just do a string.split(",") on the encoded triples and process each
element ourselves.
@CyrusNajmabadi CyrusNajmabadi changed the title Add a common, dense, format for classification operations to lower cost of processing on the host side. Release-1.5: Add a common, dense, format for classification operations to lower cost of processing on the host side. May 1, 2015
CyrusNajmabadi added a commit that referenced this pull request May 1, 2015
Release-1.5: Add a common, dense, format for classification operations to lower cost of processing on the host side.
@CyrusNajmabadi CyrusNajmabadi merged commit 4c435e0 into release-1.5 May 1, 2015
@CyrusNajmabadi CyrusNajmabadi deleted the getClassifications1.5 branch May 1, 2015 01:35
@@ -235,6 +235,9 @@ module Harness.LanguageService {
class ClassifierShimProxy implements ts.Classifier {
constructor(private shim: ts.ClassifierShim) {
}
getEncodedLexicalClassifications(text: string, lexState: ts.EndOfLineState, classifyKeywordsInGenerics?: boolean): ts.Classifications {
throw new Error("NYI");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this not implemented?

@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants