• 6 Posts
  • 58 Comments
Joined 1 year ago
cake
Cake day: July 4th, 2023

help-circle


  • ReptoriantoPythonIs Python Really That Slow?
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    19 hours ago

    My small Python (~100 lines of codes) codes aren’t maintainable, but I’m happy with them. I don’t ever plan to work on serious projects with Python, so I can’t say much about it’s maintainability. But, from limited experience, I’d rather use C++, C#, or in my special case, G’MIC if maintainability matters to me.


  • ReptoriantoPythonIs Python Really That Slow?
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    19 hours ago

    In my experience, it is.

    I had converted a Python code into G’MIC, and then some one else did a Python version of my own code. G’MIC is interpretative with JIT math parser. The results:

    Reversing digits in a 1024x1024 RGB image.

    Python: Without lookup table and numpy - 3+ minutes

    Python: With lookup table and numpy - 6.5 s (Some one else machine, but it shouldn’t take that long)

    G’MIC: Without lookup table - .3 s

    G’MIC: With lookup table - .005 s

    And I did Lavander Binary Map on my machine, you can find code for Python version in github/gmic-community/include/reptorian.gmic:

    Python: 3 s (Without lookup table)

    G’MIC:.15 s (Without lookup table)

    G’MIC: .05 s (With lookup table)

    Honestly, I find Python pretty bad for image processing in general.












  • For small projects, rewriting is often superb. It allows us to reorganize a mess, apply new knowledge, add neat features and doodads, etc.

    This. I’m coding to contribute to a open-source software with very small amount of coders, and with a non-mainstream Domain-Specific Language. A lot of the code I did before has been proven to work from times to time, but they all could benefit from better outputs and better GUI. So, I end up reengineering the entire and that’ll take a really long time, however, I do a lot of tests to ensure it works.



  • I don’t understand your problem well enough to know, if you can (or want to) use this here, but you might be able to tap into that C performance with the radix conversion formatting of printf.

    The problem is printing big binary to decimal. That’s not a easy problem because 10 is not a power 2. If we live in a base-hex world, this would be very easy to solve in O(n).

    Also, I can’t access that as G’MIC is a language that can’t really communicate with other language as it’s not meant to share memory.


  • This could be an XY problem, that is, you’re trying to solve problem X, rather than the underlying problem Y. Y here being: Why do you need things to be in decimal in the first place?

    I wouldn’t say it’s needed, but this is more of a fun thing for me. The only thing I’m using this is for Tupper’s Self-Referential formula, and my current approach of converting base 1>>24 to base 1e7 works instantly for 106x17 binary digits. When I load a image to that filter that’s greater than somewhere over 256x256, delays are noticeable because the underlying algorithm isn’t that great, but it could have to do with the fact that G’MIC is interpretative, and despite the JIT support in it, this is not the kind of problem it’s meant to solve (Domain-Specific). On the bright side of thing, this algorithm will work with any data type as long as one data type is one level higher than the other, and in this case, I’m using the lowest level (single and double), and the bigger data type, much faster it can be.




  • ReptoriantoLearn ProgrammingPalindrome Challenge in C++
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    8 months ago

    I don’t think we do have a difference in opinion. What I’m saying is that some apps are done with many years of development, and in those case, C++ will likely be the only realistic option because it is way more time-consuming to switch. For example, Krita. I do agree that when there’s a choice, C++ is less relevant these day.