Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

Added Dart version #43

Closed
wants to merge 3 commits into from
Closed

Added Dart version #43

wants to merge 3 commits into from

Conversation

Doaxan
Copy link

@Doaxan Doaxan commented Mar 16, 2021

Dart SDK version: 2.12.1 (stable) (Wed Mar 10 10:18:47 2021 +0100) on "linux_x64"

Language Simple Optimized Notes
grep 0.05 0.05 grep baseline; optimized sets LC_ALL=C
wc -w 0.26 0.34 wc baseline; optimized sets LC_ALL=C
Perl 2.09 by Charles Randall
Python 2.68 1.53
JavaScript 2.93 1.67 by Dani Biro
AWK 4.06 0.00 optimized uses mawk
Shell 16.13 1.97 optimized does LC_ALL=C sort -S 2G
Dart 37.48 2.14 by Amir Fazleev

@Doaxan
Copy link
Author

Doaxan commented Mar 16, 2021

Also, if you are interested, you can compile a binary version:

$ dart compile exe optimized.dart

@benhoyt
Copy link
Owner

benhoyt commented Mar 16, 2021

Thanks for the contribution! Unfortunately the simple.dart version takes a very long time (I think I waited to 60s and it still wasn't done, save I gave up). Is there something wrong with it, such as unbuffered stdin? I tried it on the file 1/10th the size (plain kjvbible.txt) and it takes ~9 seconds on that one. Any ideas?

@Doaxan
Copy link
Author

Doaxan commented Mar 16, 2021

I tried several times to rewrite this simple version, but my attempts were unsuccessful. ~37s on my i7-3610qm is minimum for all code variations, including "readByteSync". Can go deeper into this question, but this will no longer be the simple version 😄

dart-lang/sdk#45255

@benhoyt
Copy link
Owner

benhoyt commented Mar 16, 2021

Yeah, I don't think we can include it until we figure out and address that huge time for simple.dart, as currently it just makes Dart look really really slow. :-) Going to leave open for a while to see if others have suggestions.

@benhoyt benhoyt added help-wanted help wanted Extra attention is needed and removed help-wanted labels Mar 16, 2021
@benhoyt
Copy link
Owner

benhoyt commented Mar 24, 2021

Going to close this now due to lack of action.

@benhoyt benhoyt closed this Mar 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
2 participants