dart-sass icon indicating copy to clipboard operation
dart-sass copied to clipboard

WIP: Use worker threads in render

Open hegelocampus opened this issue 5 years ago • 3 comments

This isn't quite in a working state but I think it's at least 75% of the way there right now.

I've hit a bit of a snag with using the js.dart package and I'm pretty sure I'm doing something very wrong in lib/src/node/worker_threads.dart but I can't quite figure out exactly what.
The present issue is that essentially that nothing is actually being imported by node. My first approach was very similar to what is suggested in the api docs, but nothing was defined. So then I tried to implement the same JS require interop that I found being done in test/node_api/intercept_stdout.dart, but I'm not sure if my translation of that implementation makes sense either.

If someone could point me in the right direction as to how to use the js.dart package to import something that is not globally accessible, I would really appreciate it because I feel like I've my lost my footing and don't really know how one would/should go about importing worker_threads for use in Dart.

Todo:

  • [ ] Fix lib/src/node/worker_threads.dart
  • [ ] Clean up worker thread implementation in lib/src/node.js
  • [ ] Check that all of tests that are no longer relevant have been removed
  • [ ] Do performance tests to see benefits attained through the use of a worker thread
  • [ ] Possibly more...

Implements #868

hegelocampus avatar Jan 22 '20 22:01 hegelocampus

Hi, very interested party here :) Am very happy with this undertaking. Is this still going places?

ronkorving avatar Apr 07 '20 01:04 ronkorving

Hi, @ronkorving, I had a major change in the amount of free time I have and I definitely don't have time to complete this so it's all yours if you want it. I pushed all of my local changes to this branch and you can feel free to use those as a starting place. Good luck and godspeed.

hegelocampus avatar Apr 07 '20 17:04 hegelocampus

@hegelocampus First off, I appreciate your work so far. But I need to be very clear about my own situation... I am not in a situation right now or anytime soon where I can make this kind of contribution for a host of reasons. I hope the SASS community can help out, as this seems to be very important work (especially since fibers now officially printed a warning of obsolescence).

ronkorving avatar Apr 30 '20 03:04 ronkorving