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

Add different builds: Full and Basic #385

Closed
krisk opened this issue Apr 5, 2020 · 4 comments
Closed

Add different builds: Full and Basic #385

krisk opened this issue Apr 5, 2020 · 4 comments
Assignees
Milestone

Comments

@krisk
Copy link
Owner

krisk commented Apr 5, 2020

To save on size, it would be great to have different builds

  • Full: Builds that contain standard fuzzy searching, extended searching, and long pattern searching. These builds are larger.

  • Basic: Builds that contain only standard fuzzy searching. Use these if you're not going to enable extended searching and if the patterns that are searched are typically less than 32 characters in length.

@krisk krisk added this to the v5.2.0 milestone Apr 5, 2020
@krisk krisk self-assigned this Apr 5, 2020
krisk added a commit that referenced this issue Apr 5, 2020
@krisk
Copy link
Owner Author

krisk commented Apr 5, 2020

Added infuse.js@5.2.0-alpha.0.

Full explanation of build files.

cc: @cshoredaniel, @sidvishnoi, @ndelangen - let me know your thoughts. I figured this would be a good option to have.

Rationale:

  • Extended search and long pattern searching are recent features, therefore the vast majority of uses are already for the basic version. These users may only want the standard, basic functionality.
  • There's a non-negligible size saving:
File Size Savings
fuse.js 52.15kb -
fuse.basic.js 31.64kb 40%
fuse.min.js 18.01kb (gzipped: 5.80kb) -
fuse.basic.min.js 10.37kb (gzipped: 4.00kb) 42% (gzippped: 31%)
fuse.common.js 49.05kb -
fuse.basic.common.js 29.71kb 39%
fuse.esm.js 33.25kb -
fuse.basic.esm.js 22.49kb 32%
fuse.esm.min.js 12.25kb (gzipped: 4.01kb) -
fuse.basic.esm.min.js 7.86kb (gzipped: 3.09kb) 36% (gzippped: 23%)

@krisk krisk changed the title Added different builds: Full and Basic Add different builds: Full and Basic Apr 5, 2020
@danielfdickinson
Copy link

I like the idea. In the future I wonder if it'd be possible to make the Byteap hack I pointed you at sufficiently performant (I haven't looked deeply so it's just a thought for now) handle all lengths of string that Fuse wishes to support. It might not be possible from an algorithmic view but I'd rather like the ability to have fuzzy short and long strings without extended search included.

@krisk
Copy link
Owner Author

krisk commented Apr 6, 2020

@cshoredaniel indeed, I tested the Byteap solution you provided (which, btw - I forgot to thank you for - so, thank you!) and I'm still trying to get adequate performance out of it. The 2D array computation is the bottleneck.

Curious to know your thoughts: For very long patterns, it would seem that there would be a far smaller error-to-pattern-length ratio than for smaller patterns. That is, for longer patterns, there is "more to work with that is spelt accurately". Because of this, I went the ngram route, and it does seem to provide pretty good results.

...but I'd rather like the ability to have fuzzy short and long strings without extended search included.

Agreed. Goal is to get byteap to be close to bitap on performance.

@krisk krisk closed this as completed Apr 18, 2020
@danielfdickinson
Copy link

Hi, sorry for the long delay. For a longer patterns against the same text I think your observation holds. I suspected the 2D array would be an issue, but hopefully not insurmountable. I see you've been keeping busy and I have some reading to do.

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

No branches or pull requests

2 participants