Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Use native MarkerIndex implementation - #114

Merged
maxbrunsfeld merged 2 commits into
masterfrom
ns-native-marker-index
Nov 20, 2015
Merged

maxbrunsfeld merged 2 commits into
masterfrom
ns-native-marker-index

Conversation

@nathansobo

Copy link
Copy Markdown
Contributor

Having implemented a simpler binary-tree algorithm for the MarkerIndex, I wanted to see what we could gain by dropping it to C++. Tests of both implementations vary pretty dramatically between runs, but I'm seeing roughly the following when searching for e in jQuery after 6 runs of each version:

Implementation Typical Time Worst Time Typical Total GC Time
native 900ms 1070ms 90ms
JS 1200ms 1500ms 180ms

So the JS version is definitely more variable, slower overall, and puts more pressure on the garbage collector. A 300-600ms improvement based on my tests. Keep in mind there's a bunch of other stuff going on in this code path, but I wanted to measure a real-world use case for this data structure anyway.

@nathansobo

Copy link
Copy Markdown
Contributor Author

@maxbrunsfeld Do you by chance know the incantation I need to give Travis to use clang to build my module instead of gcc? It seems our binding.gyp flags aren't working out there.

@nathansobo
nathansobo force-pushed the ns-native-marker-index branch from 310a7c3 to f196904 Compare November 20, 2015 04:17
@nathansobo

Copy link
Copy Markdown
Contributor Author

Seems like I'm having an issue with the C++11 standard library being available.

@maxbrunsfeld

Copy link
Copy Markdown
Contributor

Currently, in marker-index's binding.gyp file, the -std=c++11 and -stdlib=libc++ are only set for OSX. We need to set the linux equivalents.

@nathansobo

Copy link
Copy Markdown
Contributor Author

@maxbrunsfeld Oh of course, we made it conditional. Do you happen to have an example of the Linux equivalents? And Windows? Did you do this for tree-sitter?

@maxbrunsfeld

Copy link
Copy Markdown
Contributor

Maybe just this:

'cflags_cc': [
        '-std=c++0x',
]

@nathansobo

Copy link
Copy Markdown
Contributor Author

Looks like you can just leave the library off. I should set up a marker-index travis build.

@nathansobo
nathansobo force-pushed the ns-native-marker-index branch from 384a038 to f196904 Compare November 20, 2015 04:38
@nathansobo
nathansobo force-pushed the ns-native-marker-index branch from f196904 to 211e371 Compare November 20, 2015 05:49
@nathansobo

Copy link
Copy Markdown
Contributor Author

🍏

@nathansobo

Copy link
Copy Markdown
Contributor Author

Probably should set this up on AppVeyor to make sure we're 🆒 on Windows.

@maxbrunsfeld maxbrunsfeld mentioned this pull request Nov 20, 2015
maxbrunsfeld pushed a commit that referenced this pull request Nov 20, 2015
Use native MarkerIndex implementation
@maxbrunsfeld
maxbrunsfeld merged commit 6157997 into master Nov 20, 2015
@maxbrunsfeld
maxbrunsfeld deleted the ns-native-marker-index branch November 20, 2015 22:50
maxbrunsfeld added a commit that referenced this pull request Nov 21, 2015
This reverts commit 6157997, reversing
changes made to 5627e80.
nathansobo pushed a commit that referenced this pull request Nov 23, 2015
…dex""

This reverts commit 20abdda.

Signed-off-by: Max Brunsfeld <[email protected]>
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.

2 participants