280 karma · joined January 11, 2014
And I fully agree with you that this glibc code is awful. As evidenced by the Plan 9 implementation, table lookups can be done simple as well, and probably perform just the same.
The answer is a pretty big yes. Glibc's isalnum is about 6-7 times faster than musl's.
Benchmark code: https://paste.sr.ht/~minus/18b44cfe58789bc1fb69494130e859a11...
Edit: I mean, sure, you could use it in your proprietary Electron app to make it more lightweight. At least on Windows, macOS and some Linuxes, the rest of users is left out then, but those free software enthusiasts are unlikely to use your software anyway.
[1] https://github.com/swaywm/wlr-protocols/blob/master/unstable...
[2] https://github.com/minus7/redshift/tree/wayland
Edit: On third thought, a bloom filter for 502M entries and a false positive rate of 0.1% ends up as a 800MiB large filter. Binary-searching the whole dump is surely faster.
The alternative to building a materialized view may be to build an index with a tsvector instead, though the that might not work since the document is not trivial; it certainly would have a problem with tags, though those can be treated separately. The huge advantage of an index is that it's automatically refreshed for you.
Realistically though, you'll probably never run into performance problems building a materialized view due to too many submitted recipes. ;)
Kotlin has infix functions which help there without treading the dangerous territory of ambiguousness
I assume Vert.x 3 is doing a better job there, but the fundamental problem remains: callbacks don't work well with exceptions. Maybe Kotlin helps wrapping this nicer, I don't know. All I know is that I'll be more careful when selecting a framework for productive use now. And maybe that I won't be using Vert.x again.
import json
with open('base.560.json') as f:
base = json.load(f)
with open('names.560.json') as f:
names = json.load(f)
print('digraph {')
for elnum, name in names.items():
print(f'e{elnum} [label="{name}"];')
for elnum, body in base.items():
for el1, el2 in body.get('parents', ()):
print(f'e{el1} -> e{elnum};')
print(f'e{el2} -> e{elnum};')
print('}')
# python3.6 code.py | dot -Tpng dot.pngNow that's just rude. Not even the linked article [0] manages to convince otherwise. In fact, it even shows the opposite standpoint:
> If your free software project suddenly gets popular, you gain resources: testers, developers and people willing to pitch in. If your free website takes off, you lose resources.
If you don't want users to use it for free, don't offer it for free, but don't insult your users.
[1] https://github.com/tdrach/Sciview/blob/master/public/javascr...
[2] https://github.com/tdrach/Sciview/blob/master/routes/api/v1/...