Reddit Programming – Telegram
Reddit Programming
212 subscribers
1.22K photos
125K links
I will send you newest post from subreddit /r/programming
Download Telegram
Predictive Thermal Management On Mobile: 0.27°C Accuracy 30 Seconds in Advance
https://www.reddit.com/r/programming/comments/1oprqnh/predictive_thermal_management_on_mobile_027c/

<!-- SC_OFF -->The hardware properties of modern mobile devices are perfect for modeling with physics. Here is what I have found. Total predictions: 2142 Duration: 60 minutes MAE: 1.51°C RMSE: 2.70°C Bias: -0.95°C Within ±1°C: 58.2% Within ±2°C: 75.6% Per-zone MAE: BATTERY : 0.27°C (357 predictions) CHASSIS : 2.92°C (357 predictions) CPU_BIG : 1.60°C (357 predictions) CPU_LITTLE : 2.50°C (357 predictions) GPU : 0.96°C (357 predictions) MODEM : 0.80°C (357 predictions) 0.27°C on the hardware that matters, 30 seconds in advance. On S25+, throttling decisions are made almost entirely based on battery status. Predictive Modeling > Reactive Throttling. By using Newton's Law of Cooling in combination with measured estimates based on hardware constraints and adaptive damping for your specific device, you can predict thermal events before they happen and defer inexpensive operations, pause expensive operations, and emergency shutdown operations in danger territory. This prevents us from ever reaching the 42°C throttle limit. At this limit, Samsung aggressively throttles performance by about 50%, which can cause performance problems, which can generate more heat, and the spiral can get out of hand quickly. Mathematical Model Core equation (Newton's law of cooling): T(t) = T_amb + (T₀ - T_amb)·exp(-t/τ) + (P·R)·(1 - exp(-t/τ)) Where: - τ = thermal time constant (zone-specific) - R = thermal resistance (°C/W) - P = power dissipation (W) - T_amb = ambient temperature Per-zone constants (measured from S25+ hardware): - Battery: τ=540s, C=45 J/K (massive thermal mass) - CPU cores: τ=6-9s, C=0.025-0.05 J/K (fast response) - GPU/Modem: τ=9s, C=0.02-0.035 J/K Prediction horizon: 30s at 10s sampling intervals Adaptive damping: Prediction error feedback loop damping = f(bias, confidence, sample_count) T_predicted_adjusted = T_predicted - damping·ΔT Maintains per-zone error history with confidence weighting. Damping strength scales inversely with thermal time constant (battery gets minimal damping due to high predictability, CPU gets aggressive damping). Result: 0.27°C MAE on battery. My solution is simple: never reach 42° C. <!-- SC_ON --> submitted by /u/DaSettingsPNGN (https://www.reddit.com/user/DaSettingsPNGN)
[link] (https://github.com/DaSettingsPNGN/S25_THERMAL-) [comments] (https://www.reddit.com/r/programming/comments/1oprqnh/predictive_thermal_management_on_mobile_027c/)
Anyone interested in F1?
https://www.reddit.com/r/programming/comments/1ops8jh/anyone_interested_in_f1/

<!-- SC_OFF -->I've created a fully functional F1 website that can scrape race data in real time and update it automatically.
If you're interested, you can take a look at the website I created, and we can discuss it. <!-- SC_ON --> submitted by /u/TravelTownEnergy (https://www.reddit.com/user/TravelTownEnergy)
[link] (https://f1-news-site.lumi.ing/) [comments] (https://www.reddit.com/r/programming/comments/1ops8jh/anyone_interested_in_f1/)
The Primeagen was right: Vim motions have made me 10x faster. Here's the data to prove it
https://www.reddit.com/r/programming/comments/1opscy5/the_primeagen_was_right_vim_motions_have_made_me/

<!-- SC_OFF -->After 6 months of forcing myself to use Vim keybindings in VS Code, I tracked my productivity metrics. The results are honestly shocking. Key findings: - 43% reduction in time spent navigating files - 67% fewer mouse movements per hour - Average of 2.3 minutes saved per coding task The vim-be-good plugin was a game changer for building muscle memory. Started at 15 WPM with motions, now consistently hitting 85+ WPM. Anyone else have similar experiences? Would love to hear if others have quantified their productivity gains. <!-- SC_ON --> submitted by /u/Ares2010- (https://www.reddit.com/user/Ares2010-)
[link] (https://github.com/ThePrimeagen/vim-be-good) [comments] (https://www.reddit.com/r/programming/comments/1opscy5/the_primeagen_was_right_vim_motions_have_made_me/)
a port of the lockfree skiplist (and list) to C++ from "the art of multiprocessor programming"
https://www.reddit.com/r/programming/comments/1opvglp/a_port_of_the_lockfree_skiplist_and_list_to_c/

<!-- SC_OFF -->this can be optimized further if you remove the java-like abstractions i implemented, and you can get a solid T type instead of the void* data i used if you inline all the abstraction helpers instead of using them but it makes the code less clear as it stands i used void* data for a reason so i could maintain the same abstraction as 'atomicmarkablereference' and behavior as java and result in a working port this can be accounted for if you want to recode the class to have all the CAS and other functions inline either way this is a decentish reference on how to implement something like the book in C++ -- with memory management hinted at (full epochmanager not included in this project so this demo does leak without teh full implementation) Edit: Technical challenges to this port and tips on porting java lock free code to c++: -porting java lock free semantics to C++ and how to do it: Copy the algorithm faithfully -- even if you have to morph the language semantics or do non traditional things ot make it work (i.e. layer base class that is strictly defined and use void* data and casting to mimick javas atomicreference and node behavior rather than using a template which is reusable and modern this method will not work as seen in all other examples on github that tried too slow and double reference cost, also doesnt follow the algorithm faithfully) Make the semantics equivalent (epoch/hazard/markable ptr design) find a way to keep the algorithm teh same while porting and fit in a memory model that works Validate a working baseline -- before making the program a concrete STL nice modern template without the hax make sure the list works -- it likely will need some changes because C++ is faster and less safe so you might need more retry checks in other places or some hardening of the algorithm and debugging still. relax. dont give up. Then inline / optimize / modernize -- this step i have not done you can do it by removing the SNMarkablepointer class and inlining all the cas and pointer operations and slowly finding ways to undo the abstractions now that the algorithm is solid this was a real challenge to port to C++ successfully and actually get the locks to function but if you do this and consider non traditional options you can successfully port java lock free semantics to C++ <!-- SC_ON --> submitted by /u/Slight-Abroad8939 (https://www.reddit.com/user/Slight-Abroad8939)
[link] (https://github.com/jay403894-bit/Lockfree-concurrent-priority-queue-skiplist-prototype/tree/main) [comments] (https://www.reddit.com/r/programming/comments/1opvglp/a_port_of_the_lockfree_skiplist_and_list_to_c/)
Pool allocator in C++23 for simulations / game engines - faster than std::pmr
https://www.reddit.com/r/programming/comments/1oq00bx/pool_allocator_in_c23_for_simulations_game/

<!-- SC_OFF -->metapool is a header-only, pool-based allocator for high-frequency allocations in simulations, game engines, and other real-time systems. It uses compile-time layout configuration with preallocated thread-local arenas and implements both std::allocator and std::pmr::memory_resource interfaces. The repository includes benchmarks against malloc, std::allocator (heap), and std::pmr::unsynchronized_pool_resource (no heap).
The metapool-backed dynamic array mtp::vault reaches up to 1300x faster reserve() than std::vector, and about 3.5x faster than std::pmr::vector. <!-- SC_ON --> submitted by /u/iftoin (https://www.reddit.com/user/iftoin)
[link] (https://github.com/esterlein/metapool) [comments] (https://www.reddit.com/r/programming/comments/1oq00bx/pool_allocator_in_c23_for_simulations_game/)
Understanding the Bridge Design Pattern in Go: A Practical Guide
https://www.reddit.com/r/programming/comments/1oq0v0q/understanding_the_bridge_design_pattern_in_go_a/

<!-- SC_OFF -->Hey folks, I just finished writing a deep-dive blog on the Bridge Design Pattern in Go — one of those patterns that sounds over-engineered at first, but actually keeps your code sane when multiple things in your system start changing independently. The post covers everything from the fundamentals to real-world design tips: How Bridge decouples abstraction (like Shape) from implementation (like Renderer) When to actually use Bridge (and when it’s just unnecessary complexity) Clean Go examples using composition instead of inheritance Common anti-patterns (like “leaky abstraction” or “bridge for the sake of it”) Best practices to keep interfaces minimal and runtime-swappable Real-world extensions — how Bridge evolves naturally into plugin-style designs If you’ve ever refactored a feature and realized one small change breaks five layers of code, Bridge might be your new favorite tool. 🔗 Read here: https://medium.com/design-bootcamp/understanding-the-bridge-design-pattern-in-go-a-practical-guide-734b1ec7194e Curious — do you actually use Bridge in production code, or is it one of those patterns we all learn but rarely apply? <!-- SC_ON --> submitted by /u/priyankchheda15 (https://www.reddit.com/user/priyankchheda15)
[link] (https://medium.com/design-bootcamp/understanding-the-bridge-design-pattern-in-go-a-practical-guide-734b1ec7194e) [comments] (https://www.reddit.com/r/programming/comments/1oq0v0q/understanding_the_bridge_design_pattern_in_go_a/)
Decoupling the Critical Path: The Asynchronous Logging Pattern
https://www.reddit.com/r/programming/comments/1oq30kf/decoupling_the_critical_path_the_asynchronous/

<!-- SC_OFF -->A Queue Separates Speed from Durability The core concept is decoupling. When a request thread generates a log message, it shouldn’t write it to disk; it should merely drop it into a non-blocking, fast in-memory queue. This queue acts as a buffer. A separate, dedicated, and less-critical worker thread is the only entity that ever reads from this queue and performs the slow, blocking disk I/O. The trade-off is minimal: a potential, tiny loss of the very latest logs if the application crashes (logs inside the in-memory queue), but the critical, customer-facing service remains lightning-fast and highly available. https://howtech.substack.com/p/decoupling-the-critical-path-the <!-- SC_ON --> submitted by /u/Extra_Ear_10 (https://www.reddit.com/user/Extra_Ear_10)
[link] (https://howtech.substack.com/p/decoupling-the-critical-path-the) [comments] (https://www.reddit.com/r/programming/comments/1oq30kf/decoupling_the_critical_path_the_asynchronous/)
The latest news in the React world: React Conf wrapup; React 19.2, the React Foundation, React Native removing old architecture. Next.js has too many directives
https://www.reddit.com/r/programming/comments/1oq71wd/the_latest_news_in_the_react_world_react_conf/

submitted by /u/vcarl (https://www.reddit.com/user/vcarl)
[link] (https://www.reactiflux.com/trannoscripts/tmir-2025-10) [comments] (https://www.reddit.com/r/programming/comments/1oq71wd/the_latest_news_in_the_react_world_react_conf/)
From Spring Boot to .NET: The Struggle
https://www.reddit.com/r/programming/comments/1oqlfik/from_spring_boot_to_net_the_struggle/

<!-- SC_OFF -->If you’ve ever switched from Spring Boot to .NET, you know… it’s not just a framework change. It’s a whole new religion. Let’s be honest — both are powerful. But when you come from the Java world of Spring Boot and suddenly land in the .NET universe, everything feels… weirdly different. Here’s my real struggle story — no sugarcoating, just developer pain 😅. My articles are open to everyone; non-member readers can read the full article by clicking this link (https://rasathuraikaran26.medium.com/from-spring-boot-to-net-the-struggle-14bf1c168ddf?sk=547e7d6f37df41b06036f5b51bbb9767) If you have any thoughts, drop a comment under my Medium article, guys! <!-- SC_ON --> submitted by /u/Rasathurai_Karan (https://www.reddit.com/user/Rasathurai_Karan)
[link] (https://rasathuraikaran26.medium.com/from-spring-boot-to-net-the-struggle-14bf1c168ddf) [comments] (https://www.reddit.com/r/programming/comments/1oqlfik/from_spring_boot_to_net_the_struggle/)