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

How to look up old articles? #34

Closed
jschlatow opened this issue Jan 23, 2024 · 5 comments
Closed

How to look up old articles? #34

jschlatow opened this issue Jan 23, 2024 · 5 comments

Comments

@jschlatow
Copy link
Member

The index page currently lists the 100 most recent articles. This makes looking up older articles (e.g. the Goa Unix tutorial) or even searching for certain keywords rather complicated.

I believe adding an archive page to the blog where all articles are listed would be the easiest solution. Any opinions on this?

@nfeske
Copy link
Member

nfeske commented Jan 23, 2024

The reason behind the limit was that the extraction of the title and the first paragraph for each article is not cheap. So I capped it. That said, I have no objection against an archive page - if you like to give it a try.

BTW, the limit does not exist on the authors page. If you know the author of an article, you should be able to find it there. Another life hack was mentioned in cnuke's latest posting, using site:genodians.org in a regular search engine. But these are excuses. If you want to improve the situation, that's very welcome!

jschlatow added a commit to jschlatow/genodians.org that referenced this issue Jan 25, 2024
Since the index page only lists the N most recent articles, there is now
way to easily lookup older articles.

This commit adds an archive page that lists all articles. The archive
page is linked at the bottom of the index page.

This commit also changes the number of articles shown on the index page
to 25 (was: 100). The RSS now contains all articles.

Fixes genodelabs#34
jschlatow added a commit to jschlatow/genodians.org that referenced this issue Jan 25, 2024
Article summaries are generated in the scope of the archive page, the
front page and the authors' index pages. By generating intermediate summary
snippets, we avoid re-generating each summary multiple times.

Issue genodelabs#34
@jschlatow
Copy link
Member Author

Commit a8d545c implements this idea.

Since you mentioned extracting the summaries for each article is not cheap, I also tried to optimise the Makefile a little so that each summary is only generated once. See a6f2c64.

jschlatow added a commit to jschlatow/genodians.org that referenced this issue Jan 25, 2024
Each echo/cat in the Makefile spawns a new bash. Since this is currently
very slow, reducing the number of these commands speeds up the generation
of index files.

Issue genodelabs#34
@jschlatow
Copy link
Member Author

Unfortunately, during test-running, I noticed that the index generation takes very long despite the aforementioned optimisation. I had a more detailed look and noticed that merely executing echos and cats in a make recipe already eats up a lot of processing time. Make spawns a new bash for each of those and spawning a bash is pretty slow. I tried to narrow this down a bit further by taking my unix_shell scenario and doing the following in a bash script:

for i in {1..5}; do
	bash -c 'echo "one" > /dev/null'
	bash -c 'echo "one" > /dev/null'
	bash -c 'echo "one" > /dev/null'
	bash -c 'echo "one" > /dev/null'
	bash -c 'echo "one" > /dev/null'
	bash -c 'echo "one" > /dev/null'
	bash -c 'echo "one" > /dev/null'
	bash -c 'echo "one" > /dev/null'
	bash -c 'echo "one" > /dev/null'
done

Executing this script takes more than 20 seconds (on base-linux). The same holds when I replace the sub-bash with cat, hence I think this is unrelated to the size of the binary.

Long story short: As a workaround, I tried to reduce the number of SHELL invocations in the Makefile. See bdbeece.

@jschlatow
Copy link
Member Author

I took a few more measurements since the results I got from the aforementioned bash script still puzzle me.

  • Running the same script in Sculpt's inspect view is pretty fast (1s).
  • In my Linux VM on Sculpt it takes ~20s on base-linux (using run/bash on the current master branch)
  • If I run my Linux natively, the effect vanishes.

Since I suspected fork() to be slow, I wrote a simple test. Irrespective of how I start up my Linux, however, forking is reasonably fast on base-linux. Yet, it is terribly slow on base-nova (running in qemu).

In summary, it doesn't look as bad as I thought yesterday.

@nfeske
Copy link
Member

nfeske commented Jan 26, 2024

Thanks for taking the initiative for the investigation.

One thing to keep in mind is that the forking of a non-trivial process (like bash) benefits a lot from cached_fs_rom. (on base-linux, cached_fs_rom is always replaced by fs_rom because core's RM service is not usable on base-linux) Hence, usually, scenarios that depend on fork run much slower on base-linux than on base-nova. I suspect that your observation of the opposite comes down to the use of qemu for running NOVA?

From a quick glance, genodians.org uses cached_fs_rom for the generate step.

chelmuth pushed a commit that referenced this issue Feb 15, 2024
Article summaries are generated in the scope of the archive page, the
front page and the authors' index pages. By generating intermediate summary
snippets, we avoid re-generating each summary multiple times.

Issue #34
chelmuth pushed a commit that referenced this issue Feb 15, 2024
Each echo/cat in the Makefile spawns a new bash. Since this is currently
very slow, reducing the number of these commands speeds up the generation
of index files.

Issue #34
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

2 participants