9
I Use This!
Activity Not Available

News

Posted almost 10 years ago by Chris Strom ([email protected])
It seems that my benchmarks may be hitting a garbage collection limit somewhere along the way. Or something.I continue to benchmark three (slightly) different implementations of the Visitor Pattern in Dart. The actual goal is reasonable assurance ... [More] that I am suggesting the most performant version of each pattern in the forthcoming Design Patterns in Dart. Toward that end, I am seeking out as many considerations involved in benchmarking patterns as possible (and I have found a number). At this point, the actual numbers are not as important as the process. Still, the numbers... [Less]
Posted almost 10 years ago by Luiz Mineo ([email protected])
Accessing a database is problably the most common task of any web application. Nevertheless, a poor database connection management is also one of the most common source of problems you can find in a server, like slowness, freezes and crashs. In this ... [More] post, I'll show some techiniques you can use to properly manage database connections using Redstone.dart. Let's start with a simple example: import 'package:redstone/server.dart' as app; import 'package:mongo_dart/mongo_dart.dart'; final DB_URI = "mongodb://localhost/dbname"; ///Returns all users recorded in the database @app [Less]
Posted almost 10 years ago by Chris Strom ([email protected])
For the second day in a row, I have to come clean on a dumb mistake. Benchmarks have a particular knack for doing me in, it would seem. And, as hard as I might try to rationalize the numbers that do not fit my world view, eventually the numbers get ... [More] me. Which is why I like them so darn much.This time around, it was Lasse Reichstein Holst Nielsen who pointed out a flaw in my numbers. Specifically, my exponentiation. While mucking with the number of times that my benchmarks get run, I tried one million... [Less]
Posted almost 10 years ago by Chris Strom ([email protected])
tl;dr You may regret reading this post. I am grateful that I wrote it because I wound up correctly a major problem in my thinking because of a dumb mistake, but it was a really dumb mistake....At the risk of overdoing my benchmark exploration for ... [More] Design Patterns in Dart, there is one other facet of them that I would like to make sure I understand.After a bit of code reorganization last night, I found that my three approaches to the Visitor Pattern broken down like:Classic Visitor Pattern (RunTime): 1374 µs.-- [Less]
Posted almost 10 years ago by Chris Strom ([email protected])
After last night, I am happy to have a new benchmark reporter that does not report 16 digits of precision when times vary after 3 digits:$ ./tool/benchmark.dart; \ echo '--'; \ ./tool/benchmark_single_dispatch_iteration.dart; \ echo '--'; \ ... [More] ./tool/benchmark_visitor_traverse.dartClassic Visitor Pattern (RunTime): 1409 µs.Classic Visitor Pattern (RunTime): 1375 µs.Classic Visitor Pattern (RunTime): 1374 µs.--Nodes iterate w/ single dispatch (RunTime): 1311 µs.Nodes iterate w/ single dispatch (RunTime): 1276 µs.Nodes iterate w/ single dispatch (RunTime): 1290 µs.--Visitor Traverses (RunTime): 1388 µs.Visitor Traverses (RunTime): 1350 µs.Visitor Traverses... [Less]
Posted almost 10 years ago by Chris Strom ([email protected])
I continue to explore benchmarking design patterns for Design Patterns in Dart. I am still in the preliminary stages of research for the book so the actual benchmarks are not as important as how I want to benchmark. The simple answer is to use ... [More] benchmark_harness—the official benchmark harness for Dart. As I have found over the past couple of days, there is more involved than simply using it.I have already determined that it is best to run implementation comparisons in separate files. Further investigation by Vyacheslav Egorov (aka @mraleph) suggests that... [Less]
Posted almost 10 years ago by Luiz Mineo ([email protected])
Hey everyone! Welcome to the new Redstone.dart blog :) Recently, I've received a lot of feedback and questions about Redstone through many different channels, such as github, google plus, hangouts, e-mail and so on. It's really cool to see other ... [More] developers excited about this project, but I've just realized that we need a proper place to discuss about it. So, to fix this issue, I've created a mailing list for us: http://groups.google.com/d/forum/redstonedart If you have questions, or want to give some feedback about the project, don't hesitate to join the group and send us a message. Although, if you... [Less]
Posted almost 10 years ago by Chris Strom ([email protected])
I learned a good lesson last night in regards to benchmarking Dart code: keep everything separate. Keep the different benchmark harnesses in separate scripts. I think it also a good idea to keep the implementations being benchmarked in separate ... [More] libraries. With that in mind, I add a new approach tonight (bringing the number of implementations up to three) and try them out in JavaScript.I am still benchmarking the Visitor Pattern as background research for the future Design Patterns in Dart. Although I tend to hate the pattern when I come across it in... [Less]
Posted almost 10 years ago by Chris Strom ([email protected])
I think I am nearly done with my exploration of the Visitor Pattern for Design Patterns in Dart (at least the early research). I do not feel as though I have put nearly as much effort into it as I did the Factory Method Pattern though. So, at the ... [More] risk of dragging this out too much...There are not many variations of the Visitor. One possible suggestion from the Gang of Four book is to change the iterators used to move through composites in the node structure being processed. While reading this, I... [Less]
Posted almost 10 years ago by Chris Strom ([email protected])
I have felt the pain of adding new nodes and structure in the Dart version of the Visitor Pattern, but I have yet to try the opposite. Tonight, I try adding a new Visitor in the hopes that the pattern really does make this easy.All indications are ... [More] that this should be nearly trivial. The Gang of Four book says the pattern “lets you define a new operation without changing the classes of the elements on which it operates.” I have no reason to doubt this. Still, I need to give it whirl for... [Less]