greg7mdp / parallel-hashmap

A family of header-only, very fast and memory-friendly hashmap and btree containers.
https://greg7mdp.github.io/parallel-hashmap/
Apache License 2.0
2.52k stars 238 forks source link

Equations in Readme are unreadable in Github's dark mode #85

Closed kkiningh closed 3 years ago

kkiningh commented 3 years ago

Github's dark mode (under https://github.com/settings/appearance) make it very difficult to read the equations in the Readme. Here's what I see in Google Chrome:

Screen Shot 2021-03-17 at 4 52 33 PM

greg7mdp commented 3 years ago

I thing this is similar to issue #80, but unfortunately I don't have a good solution for this. I'm open to a solution that would look good in all modes if someone has a suggestion.

kkiningh commented 3 years ago

IMO, it would look better to just have a white background rather than be completely unreadable. If you don't like how it looks in the alternating background of the table, maybe you could try adding rounded corners plus a single pixel grey border around the image? That would make it look a little less obviously out of place.

equations

Another option might be to just use plaintext instead of equations.

I agree there may not be a good solution currently though.

kkiningh commented 3 years ago

Example with more aggressive rounding + Github's dark dimmed theme.

github_equations

greg7mdp commented 3 years ago

This looks great! Do you want to provide a PR with the updated bitmaps? I would really appreciate it :-)

kkiningh commented 3 years ago

Sure - is there somewhere with the latex written out so I can copy and paste? Do you like the second or first one better?

greg7mdp commented 3 years ago

Oh, I don't believe I used latex (directly), if I remember correctly I think I used an online equation editor. I was thinking of starting with the existing images (which have a transparent background), and using photoshop fill the transparent background with white within a round rectangle mask or something. You think you might be able to do something like that?

greg7mdp commented 3 years ago

I do like the more aggressive rounding more. Oh and if you can please let me know what you use phmap for!

kkiningh commented 3 years ago

I just typed it out myself. There was a parenthesization error in the first one and I removed the italics for the equations. Below is the latex I used for future reference.

O\left(\frac{\mathrm{size}()}{\mathrm{load\_factor}()} * (\mathrm{sizeof}(C :: \mathrm{value\_type}) + 1)\right)
O\left(\frac{\mathrm{size}() * 9}{\mathrm{load\_factor}()} + \mathrm{size}() * \mathrm{sizeof}(C :: \mathrm{value\_type})\right)
O\left(\frac{\mathrm{size}()}{0.4375} * (\mathrm{sizeof}(C :: \mathrm{value\_type}) + 1) * 0.5\right)
O\left(\frac{\mathrm{size}() * 9}{0.4375} * 0.5\right)
O\left(\frac{\mathrm{size}()}{0.4375} * (\mathrm{sizeof}(C :: \mathrm{value\_type}) + 1) * 0.03\right)
O\left(\frac{\mathrm{size}() * 9}{0.4375} * 0.03\right)
greg7mdp commented 3 years ago

Thanks again!