egraphs-good / egglog

egraphs + datalog!
https://egraphs-good.github.io/egglog/
MIT License
458 stars 54 forks source link

New-type return type of Parser::map #470

Open DaniPopes opened 1 week ago

DaniPopes commented 1 week ago

Fixes https://github.com/egraphs-good/egglog/issues/468. I'm not sure why this works but it probably has something to do with return-position impl Trait in traits having some exponential behavior in rustc.

Compile times for cargo build --bin egglog went from 40s to 8s on my machine, with egglog (library) now taking about 3s.

codspeed-hq[bot] commented 1 week ago

CodSpeed Performance Report

Merging #470 will not alter performance

Comparing DaniPopes:parser-map (9c1663d) with main (2c8d947)

Summary

✅ 8 untouched benchmarks

ezrosent commented 1 hour ago

Thanks for the debugging around slow compile times , and for following up in an issue on rustc.

Sorry for the delayed response here. I agree with Alex. I think the added parse methods probably outweigh the benefit of having map being a method. I think it may be better to revert to map being a function.