Ondra Urban

Results 108 comments of Ondra Urban

I'd also like to support the idea of having a `nullable` validator. Even though I generally agree with https://github.com/sindresorhus/meta/issues/7, `null` is out there in the wild and since dynamic type-checks...

Hmmm, immediately after submitting this I got an idea that the label inference might be the culprit and it surely is: ``` plain js took 18.78ms on average. ow took...

Another potential improvement lies in the execution of `ow.object.partialShape()` and `exactShape()` functions. It seems from testing that no matter how many properties there are in the validated object, those functions...

> Yeah, it's slow because it needs to read the file from disk and parse it. Label inference is only called when something fails though, which should not be that...

Hi @sindresorhus @SamVerschueren just wanted to bring to your attention that the validations above are about 15 times slower in `[email protected]` than in previous versions. I might be able to...

@vladfrangu See the thread above for examples. In real life, it's this test: https://github.com/apify/apify-js/blob/11ff217a2af12cbb900b6de827de710dad030786/test/request.test.js#L123 On 0.22 it runs in 450+ms for me locally, whereas with 0.21 it runs in ~30ms.

Sure, the predicates are here: https://github.com/apify/apify-js/blob/11ff217a2af12cbb900b6de827de710dad030786/src/request.js#L19 And the validation code is here: https://github.com/apify/apify-js/blob/11ff217a2af12cbb900b6de827de710dad030786/src/request.js#L107 We're using the workarounds that I explained in the above comments to speed up the validation.

@vladfrangu Thanks for all the work you clearly dedicated to this, but I'm not sure how Jest is relevant. Your tables clearly show that there's a ten-fold or larger slowdown...

Well, for this to work reliably, we have to add a flag that marks a request as failed. Apify API does not support it, so it would have to be...

We just need to be careful not to finish the crawler when there are still locked requests in the queue. Even if we don't manage to call the unlock method...