es
Feedback
C++ - Reddit

C++ - Reddit

Ir al canal en Telegram

Stay up-to-date with everything C++! Content directly fetched from the subreddit just for you. Join our group for discussions : @programminginc Powered by : @r_channels

Mostrar más
228
Suscriptores
Sin datos24 horas
-17 días
+130 días
Archivo de publicaciones
What is currently the fastest algorithm for parsing a json string into an Uint/Int? I can't really find anything definitive for this, given that it needs to be able to parse from decimals/scientific notation into integer/unsigned integers, and so I propose that [this](https://github.com/RealTimeChris/Jsonifier/blob/dev/Include/jsonifier/StrToI.hpp) may be it. What do you guys think? Here's some benchmarks of it vs the implementation from Glaze, which is basically an improved version of the code from Yyjson: CLANG/UBUNTU: Library: Jsonifier-Parsing-Function is faster by roughly: 179.101%., for benchmark stage: Uint-Integer-Short-Tests Library: Jsonifier-Parsing-Function is faster by roughly: 86.4299%., for benchmark stage: Uint-Integer-Tests Library: Jsonifier-Parsing-Function is faster by roughly: 109.608%., for benchmark stage: Uint-Decimal/Scientific-Nocation-Tests Library: Jsonifier-Parsing-Function is faster by roughly: 184.907%., for benchmark stage: Int-Integer-Short-Tests Library: Jsonifier-Parsing-Function is faster by roughly: 105.403%., for benchmark stage: Int-Integer-Tests Library: Jsonifier-Parsing-Function is faster by roughly: 138.133%., for benchmark stage: Int-Decimal/Scientific-Nocation-Tests GCC/UBUNTU: Library: Jsonifier-Parsing-Function is faster by roughly: 175.69%., for benchmark stage: Uint-Integer-Short-Tests Library: Jsonifier-Parsing-Function is faster by roughly: 103.627%., for benchmark stage: Uint-Integer-Tests Library: Jsonifier-Parsing-Function is faster by roughly: 113.008%., for benchmark stage: Uint-Decimal/Scientific-Nocation-Tests Library: Jsonifier-Parsing-Function is faster by roughly: 183.695%., for benchmark stage: Int-Integer-Short-Tests Library: Jsonifier-Parsing-Function is faster by roughly: 104.514%., for benchmark stage: Int-Integer-Tests Library: Jsonifier-Parsing-Function is faster by roughly: 116.487%., for benchmark stage: Int-Decimal/Scientific-Nocation-Tests MSVC/WINDOWS: Library: Jsonifier-Parsing-Function is faster by roughly: 73.3105%., for benchmark stage: Uint-Integer-Short-Tests Library: Jsonifier-Parsing-Function is faster by roughly: 50.8342%., for benchmark stage: Uint-Integer-Tests Library: Jsonifier-Parsing-Function is faster by roughly: 102.364%., for benchmark stage: Uint-Decimal/Scientific-Nocation-Tests Library: Jsonifier-Parsing-Function is faster by roughly: 81.6108%., for benchmark stage: Int-Integer-Short-Tests Library: Jsonifier-Parsing-Function is faster by roughly: 58.8986%., for benchmark stage: Int-Integer-Tests Library: Jsonifier-Parsing-Function is faster by roughly: 106.426%., for benchmark stage: Int-Decimal/Scientific-Nocation-Tests``` https://redd.it/1fzbbad @r_cpp

A popular but wrong way to convert a string to uppercase or lowercase https://devblogs.microsoft.com/oldnewthing/20241007-00/?p=110345 https://redd.it/1fz7qhw @r_cpp

Is code a liability? - Kevlin Henney https://youtu.be/YUj7IPs6MJM https://redd.it/1fz71yc @r_cpp

C++ HtmlParser, BeautifulSoup-like parsing library Hi, I'm Cabbage. This does happen to be the first public post i've made about a project, albeit probably for my most useful project. This is a html parsing library which is heavily inspired by bs4 in python. Somewhat like how cpr is inspired by requests. This is EXTREMELY new. It *does* function, and no doubt you will find bugs (dont bully my codebase), I'm open to various suggestions and whatever. I did start writing this literally this week but I plan on continuing it for a while. I hope it helps someone or you think its cool :p GitHub: https://github.com/JustCabbage/HtmlParser Reference: HTML5 https://redd.it/1fz54mg @r_cpp

Most Suitable Design Pattern Hey everyone, I recently inherited a pretty substantial codebase for an IoT device. The device makes use of AWS, MQTT for messaging, solenoids and a bunch of other stuff. The device links with a cloud backend and settings and other things can be updated remotely via a mobile app. I'm in charge of the entire codebase and I've come to a pretty big cross roads and can't really decide what's the best thing to do. As a quick summary, nearly every class the codebase uses is implemented as a Meyer's singleton with its own thread, and the majority of these make use of Class A which is also a Meyer's singleton with its own thread. I know how we all feel about Singleton's, but I'm not sure if there is a better pattern I can use, or if it is even worth trying to re-write it at all. Each class satisfies the requirement that only one of them should be active at a time so it makes sense why the previous guy implemented it this way, but I'm not sure if there's a better one. I have fixes for the destructor initialisation fiasco, and each of the classes is thread safe since it's a Meyer's Singleton, but I still have this thought in the back of my head that it might be worth refactoring Any advice or thoughts would be greatly appreciated. https://redd.it/1fz1ugd @r_cpp

Meetingcpp online C++ job fair this afternoon (join until 18:00 Berlin) https://live.remo.co/e/meetingcpp-online-c-job-fair-aft https://redd.it/nkplkx @r_cpp

Fast And Memory Efficient Hashtable Based On Robin Hood Hashing https://github.com/martinus/robin-hood-hashing https://redd.it/nkoiyo @r_cpp

Using OpenGL for 2D graphics in an audio plug-in with JUCE. https://link.medium.com/07ayjNT2K6 https://redd.it/nkm7gi @r_cpp

Minilib for typesafe handling of sets of enums https://github.com/cdeln/cpp_enum_set https://redd.it/nkisob @r_cpp

How do you guys manage "global" state? Often enough, certain data or functionality is used in various places in code. Think of configuration, logging, monitoring, subsystem handles, ... I came around 3 ways of passing such information around my code: * Global variables Almost always the wrong choice for me. I think pros and cons have been discussed exhaustivly many times before. * Accessors to static data ​ my_handle get_handle() { static my_handle handle{}; return handle; } I kind of like this and it works especially well for singleton-like types. But there is no way to enforce who is allowed to access the information. * Passing as parameters That's the most common way I think. It becomes clear from the function signatures alone who needs what information, but can end up getting quite verbose. I dislike especially the situations where you need data deep down in the call stack, and have to drag along the extra parameter. Would you share your thoughts, opinions, experiences in this aspect of C++ software design with me? I hope this is specific enough for r/cpp. I feel like this is directly related to the features the language offers. I'd also be very happy if you could share hints which open source code to look into to see various approaches in action. https://redd.it/njvsht @r_cpp

What is better to use, member initialization, or uniform initialization? I saw many examples of each of these in internet and books. Some say that uniform is better, some say that there is no need in uniform initialization and better use member initialization. So I need to ask. What is better for initializing class parameters? https://redd.it/njyd1p @r_cpp

Why is printf("%f",3); 0.000000 and not a garbage value? I was expecting garbage, because %f expects 8bytes and the int can only provide 4 , the rest 4 memory cells will provide garbage right.. https://redd.it/nk1gr3 @r_cpp

So, how does Module work for game development ? All of the projects I worked on with C++ involved video games, so naturally I'm very interested with faster compilation times and modernity. I'm curious to know if anyone experimented or succeeded to build a PoC game or engine using C++ Modules ? Games relies heavily on macros, especially when it comes to reflection, serialization and binding purposes. How is this supposed to work with modules and what are the alternatives ? https://redd.it/njtu6m @r_cpp

C++ - Reddit - Estadísticas y analítica del canal de Telegram @r_cpp