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

Random notes #19

Open
didib opened this issue Nov 4, 2021 · 0 comments
Open

Random notes #19

didib opened this issue Nov 4, 2021 · 0 comments

Comments

@didib
Copy link

didib commented Nov 4, 2021

Great game! :-)

Some comments:

  1. You are welcome to play with grep on shorter/longer search strings, non-zero input (random or not), locale (force it or not force to handle unicode), etc., and then either do nothing (as the grep question is already interesting as is), or add more text, or split to more questions. And perhaps mention/link to the boyer-moore algo (e.g. on wikipedia) - I still remember my fascination when learning it many years ago...
  2. fill_array*.c do quite a lot more than writing to memory. Specifically, 'array[i] = j' and 'array[j] = j' are writing ints to a char/byte array. I didn't check the assembly language result, but I am pretty certain that you either write 4 bytes in a loop, or spend at least some time on not writing (coercing the int to byte). Not sure how to best fix this - perhaps you should create a small array (that will fit in cache) and copy it to the larger one, or perhaps at least make the array of int's (and use sizeof for determining the amount written), not sure.
  3. Perhaps consider rewriting download_webpage.py to be more systematic/methodical - perhaps run a local web server, perhaps one with designed-in simulated latency (if you can find one, or just write one, or use some network simulator). I wouldn't be surprised if google rate-limits you - in addition to what you already mentioned about network speed/latency. I realize that simulating a 'get something over the Internet' is interesting in itself, though... I also do not think it's that fair against google, although I guess so few people actually run this thing that it's a non-issue.
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

No branches or pull requests

1 participant