Skip to content

Add streaming extractor#9

Open
hughrawlinson wants to merge 4 commits intomasterfrom
add-streaming-extractor
Open

Add streaming extractor#9
hughrawlinson wants to merge 4 commits intomasterfrom
add-streaming-extractor

Conversation

@hughrawlinson
Copy link
Copy Markdown
Owner

No description provided.

Comment thread src/generic-tsconfig.json
"strict": true,
"noImplicitAny": true,
"module": "ESNext",
"moduleResolution": "node",

This comment was marked as resolved.

default as Meyda
} from "meyda";
import { Observable, from, of } from "rxjs";
import { take, bufferCount, map, tap } from "rxjs/operators";
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This file should be it's own commit, and subsequent commits should maybe have one implementation that's observable compatible. I think the observable implementation is more concise and clearer regardless.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

To clarify: It might be good to remove the original implementation, and have the original two feature extractors use the observable based implementation. First would have to make the observable implementation handle hopping windows (negative and positive offsets). Maybe a separate PR, this could go in a GH issue.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Then again, it might not, since the inline worker would now have rxjs code in it even if it's not strictly needed, and would increase the bundle size. To do: figure out how much it would increase the bundle size.

Comment thread src/main/index.ts
);
}

export function extractFeatureObservable({
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Should there be a separate implementation of this library that does observable? Maybe...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

The thinking here was that rxjs might bump the bundle size too much to be acceptable for a use case where you don't need streaming.

const [buffers, features, extractionParameters, internalParameters] = data;

postMessage(await extractFeatures(buffers, features, extractionParameters));
const batchSize = internalParameters.batchSize || buffers.length;
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This PR isn't mergeable until this breaking change disappears.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I've forgotten exactly why this is a breaking change, the tests pass. The tests probably aren't good enough.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Also, we're in alpha, we don't care about no stinkin breaking changes!

@hughrawlinson hughrawlinson force-pushed the add-streaming-extractor branch from 7826709 to 639a242 Compare February 21, 2020 12:37
@hughrawlinson hughrawlinson force-pushed the add-streaming-extractor branch from 639a242 to 09a33c8 Compare February 21, 2020 12:55
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

Successfully merging this pull request may close these issues.

1 participant