Closed crides closed 8 months ago
It's a cool idea but when I casually benchmarked it, a small single-threaded loop got ~30% slower :-/
s, t := 0, time();
for (a <- 0 til 20000000) (s += a);
print(s, time() - t)
huh, I haven't even benchmarked actually :joy:. It's not too surprising that the performance is worse, due to all of the locks/atomics. I don't have better ideas at the moment though. Maybe I'll only use the commit (locally) when I need parallelism...
Just replaced
Rc
withArc
,RefCell
withRwLock
, and slappedSend + Sync
on the traits, and usedrayon
for the jobProbably not a great idea as I have no idea how much synchronization is actually needed, but it does make things run faster so :shrug: