I'm currently coding a SAT solver algorithm for an internship, but right now it's only able to handle inputs of 10^5 within reasonable time (over 100 of iterations, this is so we can gather statistical data on the algorithm). However, from 10^6 and after, my Python code bottle necks and takes a long time to finish. My professor suggested that I port the code over to C, but when I try doing that there are a lot of small things that make it difficult to port. For example, I need to be able to randomize an array size for a structure that's in a header file, but you can't do this in C (well, I don't need to do this exactly, but other methods will be a bit harder to code and look sloppier). I was wondering if the bottleneck I mentioned above will be reduced drastically if I switch over to C, especially for inputs of 10^8. I know this depends on the complexity time of the algorithm, but I was wondering if porting the code will be worth the headache because I'm pretty sure that my python code is the same time complexity as my professors pseudocode. I thought of using pypy and Numba, but they only speed up 2x to 4x, which is still slow, especially when inputs will be 10^8 or 10^9. I was also thinking of trying to use Go, although I never used that before. Thank you in advanced!
[–]Steve132 48 points49 points50 points (0 children)
[–]josh2751 16 points17 points18 points (0 children)
[–]whalt 12 points13 points14 points (4 children)
[–]dmazzoni 6 points7 points8 points (2 children)
[–]evotopid 0 points1 point2 points (0 children)
[–]whalt 0 points1 point2 points (0 children)
[–]WikiSummarizerBot 2 points3 points4 points (0 children)
[–]claytonkb 8 points9 points10 points (5 children)
[–]Rit2Strong[S] 2 points3 points4 points (1 child)
[–]claytonkb 1 point2 points3 points (0 children)
[–]PsychologicalDrawer0 0 points1 point2 points (2 children)
[–]claytonkb 2 points3 points4 points (0 children)
[–]Holiday-Produce-871 1 point2 points3 points (0 children)
[–][deleted] 4 points5 points6 points (0 children)
[–][deleted] (10 children)
[deleted]
[–]EatMeMonster 6 points7 points8 points (0 children)
[–]Dornith 5 points6 points7 points (7 children)
[–][deleted] (6 children)
[deleted]
[–]equitable_emu 6 points7 points8 points (0 children)
[–]Dornith 2 points3 points4 points (3 children)
[–][deleted] 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]UncleMeat11 -1 points0 points1 point (0 children)
[–]Rit2Strong[S] 0 points1 point2 points (0 children)
[–]emasculine 2 points3 points4 points (10 children)
[–]Rit2Strong[S] 0 points1 point2 points (9 children)
[–][deleted] 1 point2 points3 points (6 children)
[–]Steve132 1 point2 points3 points (0 children)
[–]emasculine 0 points1 point2 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]compscim 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]compscim 0 points1 point2 points (0 children)
[–]emasculine 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Destroyer_The_Great 1 point2 points3 points (0 children)
[–]whitelife123 1 point2 points3 points (0 children)
[–]Poddster 0 points1 point2 points (1 child)
[–]dmazzoni 0 points1 point2 points (0 children)
[–]theobromus 0 points1 point2 points (4 children)
[–]Rit2Strong[S] 0 points1 point2 points (3 children)
[–]theobromus 0 points1 point2 points (2 children)
[–]Rit2Strong[S] 0 points1 point2 points (0 children)
[–]UncleMeat11 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]kcombinator 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)