The Four Screens

I’ve been thinking lately howВ a game programmer should have not the (hopefully) standard two, but four monitors on his PC. Besides the usual two for the game itself and his favorite IDE, he must have one for the generated machine code, because you can’t really trust a compiler even with the most basic of tasks. And one for his profiler of choice, to always keep an eye of what the game really is doing.

Real-world example:В a misunderstood feature for dynamic remapping of terrain layer textures leads to a per-frame resolving of texture filenames to device texture objects. Textures are looked up by filename, which must be handledВ without regard for case; and stored in a hash map. The unfortunate combination of three seemingly simple, convenient tools - dynamic reloading of the terrain table, a case-insensitive std::string wrapper, and a hash-map - lead to 40 000 calls to tolower() per frame. Not a big deal - nothing you’d even think about without a profiler. But here goes 1% of the total CPU time of a completely CPU-bound game - a percent which you’d have a hard time to shave off somewhere else.

Another one: an innocent, smallish 12-byte structure is augmented with a “dirty” flag, to keep track of yet another type of dynamically modifiable data. The structure is put in a three-dimensional array - which have to be banned outright, by the way. Then the array is “sliced” - iterated over (the wrong) two of the dimensions, and the dirty flag is checked.В This particular access pattern and the particular arrayВ and structureВ sizesВ lead to about of 4000 successive cache misses per-frame. Which take up to 2.5% of the frame time on the target platform, if you’re going for 30 fps. See it in a profiler, and spend 5 minutes to move the dirty flags to a separate array (or keep a “modified data” queue aside if you have 30 minutes), and shave off these 2.5%. Or don’t, andВ shipВ a seemingly bottleneck-free, but severely underpeforming game, full of such pearls of wisdom.

44 Responses to “The Four Screens”

  1. look4awhile Says:

    A static call-graph of a single frame is often an interesting source of wisdom. The surprising amounts of ‘how the hell did this work before’ can be turned into a _daily_ wtf.

  2. Feed Search Engine - All Fresh Articles And News Are Here Says:

    […] The Four Screens […]

  3. Christian Louboutin Says:

    gucci outlet

  4. abercrombie fitch Says:

    Thanks for sharing with us.Welcome to our abercrombie & fitch online store to choose the Abercrombie and Fitch Mens Polos to wear.You may love this style shirts.

  5. abercrombie fitch outlet Says:

    Thank you for sharing with us.I love this blog very much.Welcome to my own blog abercrombie and fitch outlet to have look.In our own blog,there are many kinds of abercrombie outlet dress for you to choose.

  6. ralph lauren outlet Says:

    Weclome to ralph lauren outlet to choose the items you need.In the herve leger dress online store,you could find a lot of things you need here.

  7. Dell Inspiron 1545 Akku Says:

    Firefox Browser Händler Mozilla hat heute Unternehmen, die digitale Zertifikate zu Dell Vostro 3300 Akku verkaufen in der Woche, um Maßnahmen zu ergreifen, um ihre Sicherheit nach einer Zertifizierungsstelle (CA) wurde latitude E6400 Akku gehackt und Google Mail-Nutzer in Iran wurden in einer kürzlich angegriffen zu verbessern.

  8. supra skytop Says:

    I love this blog very much.I will keep on visit supra skytop sale everyday and then introduce the Supra Skytop Shoes to all of my friends.

  9. nike air max Says:

    Thank you for shairing with us.Wear the nike air max shoes to enjoy sports will be your best choose.The Nike Air Max 2012 Mens shoes are the newest style shoes in this year,never miss it.

  10. Louis Vuitton Says:

    so good

  11. abercrombie outlet online Says:

    I love this blog very much.Welcome to my lovely blog abercrombie & fitch outlet to have a look.In my blog,I share a lot of discount information to each other,such as the abercrombie and fitch outlet store sale good quality things.

  12. tory burch outlet Says:

    Wear the Tory Burch Flats are so comfortable and beautiful.When you wear the tory burch shoes and take the Tory Burch Sandals to go outside,you are the most fashion women.

  13. abercrombie and fitch outlet Says:

    I like to shop from abercrombie & fitch outlet and order the cheap things from here.The hollister outlet is doing sale promotion now,never miss this franklin marshall outlet in this season.

  14. canada goose jacket Says:

    I like wearing the canada goose jacket very much.When face the cold day,the Canada Goose Trillium Parka will keep me away from the cold.

  15. tory burch outlet Says:

    Come here to visit the best hollister outlet online store.The tory burch outlet supply all kinds of new style shoes and bags in a low discount.Enjoy shopping now.

  16. franklin marshall Says:

    franklin marshall Clothing Company is an Italian company that creates and produces clothing and accessories inspired by the American Vintage College spirit, as exemplified by Franklin & Marshall College….

  17. domain hosting india Says:

    thanks for sharing such informative and fantastic post..

  18. Nike Dunks High Says:

    Nike brand shoes help the buyers to select the best pair of nike dunks high that they want to keep for themselves. The
    Womens Nike Dunks Heels
    is both fashion and practical that it is time to own one pair.

  19. nfl hats Says:

    The clock in the high church tower struck obey hats and the sound made him remember his parents’ early love for him ymcmb hats

  20. Zoom Kobe Shoes Says:

    I love to shop new and cheap Zoom Kobe Shoes Zoom Kobe Shoes online.When I enter the nike basketball shoes online store,I find my lovely Nike Air Max 2012 Women Nike Air Max 2012 Women cheap sale here.

  21. christian louboutin outlet Says:

    Christian Louboutin celebrates 20 years of iconic designs with a capsule collection compiled of favorite pieces from decades past. The Christian Louboutin Sandals is suitable for women who pursuit high quality of live, welcome to our christian louboutin outlet to own one pair.

  22. Franklin Marshall Outlet Says:

    Welcome to choose the Franklin and Marshall Hoodie Sweatshirts which is easygoing, comfortable and everyday-proof from our franklin marshall outlet online shop, you can get all kinds of 2012 newest style franklin marshall clothing in our online store.

  23. Jordan Hats For Sale Says:

    He wore the clothes he was married very rare and it was not thought before feel curious about Cheap MLB Hats Sale the papers. They were bills of household furniture, not yet paid. “Look here,” she said on the night after being washed and had his Cheap DC Shoes Hats dinner. “I found it in the pocket of your wedding-mantle. You have not yet paid the bills?” “No, I have not had the chance.” “But Wholesale NBA Hats you told me everything was paid. I’d better go in Nottingham on Saturday and settle them. I do not like sitting on chairs and eating another man a table without pay.” He did not wholesale NFL hats answer. “I am your bank book, I can not do?” “Tha can ha’e, what good is it will be with you.” “I thought —” she began. He told her he had a good bit of money left. But she realized it was useless to ask wholesale NHL Hats questions. She sat rigid with bitterness and indignation. The next day they went down to see his mother.

  24. RADO Watches for sale Says:

    I really feel that you simply are an professional in editing. I am starting a internet site soon, as well as your particulars will be pretty useful for me. many thanks for all of your help and wishing you every one of the best ..brm watches replica

  25. Christian Louboutin Uk Says:

    If you do not own one pair of Christian Louboutin Sandals in this season, you can come to our Christian Louboutin Uk outlet online shop to have one pair Christian Louboutin Pumps with lowest discount.

  26. abercrombie and fitch outlet Says:

    Where is the best place for young people to shop cheap and high quality clothes.The answer no doubt to be the abercrombie and fitch outlet abercrombie and fitch outlet store.When you see abercrombie fitch outlet abercrombie fitch outlet store at the first sight,you may love it.We think abercrombie & fitch outlet will be your first choice when you want to shop online.I love abercrombie fitch outlet too.

  27. ralph lauren sale Says:

    Cheap polo is the perfect choose for men to wear in the summer.At this time,cheap and beautiful herve leger sale dresses are women’s best love.If you are young boys,never miss franklin marshall outlet store.You can find a lot of lovely clothes in these online store.

  28. franklin marshall outlet Says:

    Polo Ralph Lauren and Franklin & Marshall are both the famous brands in the world. The clothing fashioned from a durable, yet comfortable, woven cotton mesh that gets better with each washing. Welcome to the franklin marshall outlet online shop, where you can find the right outfit for you. You can get all kind of 2012 new style polo shirts in the ralph lauren uk outlet store,for example the 2012 london olympic ralph lauren polo.

  29. Ralph Lauren Outlet Says:

    I like to shop good quality polos from Ralph Lauren Long Sleeve Polos store.In the Ralph Lauren Outlet,you can find a lot of new style clothes sale in a cheap price,such as Ralph Lauren Hoodies and Ralph Lauren Pony polos.Buy your own special Ralph Lauren polos online now.

  30. michael kors outlet Says:

    In this season, a michael kors bags is an indispensable fashion item, our michael kors outlet online store can help you pick out bags they think flatter you. And welcome to Marlboro Cigarettes Online shop to choose the brand cigarettes if you are a smoker.

  31. jimmy choo outlet Says:

    The perfect collocation in the party is wearing the Jimmy Choo Boots shoes with luxury karen millen dresses to show off women’s special body curve.When you try on jimmy choo shoes,you will become so confidence.At this time,a piece of Karen Millen One Shoulder dress will help to show your S body curve.You must can enjoy the party with karen millen dress and jimmy choo shoes.

  32. christian louboutin discount Says:

    It is the right time to have a pair of christian louboutin shoes right now. And the Christian Louboutin Discount online store is the NO.1 choice to shop. When you have a sport, a polo is the must-have items, welcome to our ralph lauren outlet to choose one.

  33. cheapsupremejie Says:

    Just write to the author to share, if you are interested in the hat just to [url=]my site[/url] to see!I hope we can be friends!

  34. hatsglasses Says:

    Thank you very much of the wind direction, and I am also happy to share their favorite things to everyone.If you like the style novelty [url=]hat[/url], [url=]glasses[/url] then look to my website!I believe it will surprise you!

  35. Franklin Marshall Outlet Says:

    Known for their iconic collegiate logo, Franklin & Marshall draw inspiration from American varsity style to create a range of wearable casual clothing that includes everything from hoodies to graphic print t-shirts. The Franklin Marshall Jackets has top quality at low price and excellent customer service.Choose the franklin marshall clothing in our Franklin Marshall Outlets is your perfect choice.

  36. chan luu wrap bracelet Says:

    Ok, how would i add your rss feed to my reader, sorry this is all new stuff for me so please be patient with me, thanks. Smile

  37. Ralph Lauren Outlet Says:

    Welcome to Ralph Lauren Outlet to order what you like.If you need bags,never miss michael kors outlet online store.

  38. BMW OPS Diagnostic Says:

    BMW OPS Diagnostic & Programming Tool Product Name: BMW OPS Diagnostic & Programming Tool Part 100Z

  39. authentic jordans Says:

  40. rare jordans Says:

    rare jordans

  41. Cheap Jordans For Sale Says:

    Cheap Jordans For Sale

  42. Authentic Retro Jordans Says:

    Information very pleasant and unique that I have read in my life through action.

  43. jordan retro shoes for sale Says:

    Chinese will brake Jiang Jiang is the ‘ dream ‘ word apricot Apricot apricot Apricot . ’s first song ” Zhang dilute amount of volume around a sunflower wax chul said , rust rust rust Li Li groups Wen Qing slender body parts were all taken condolence condolence condolence condolence woo dead corpse with a very nice alternative to punishment for fonts Mongolia, Mongolia and Mongolia Mongolia , especially in the “dream Dangdang

  44. Kids ATVs Says:

    Obtaining this kind of faulty trailers also can heap extra prices upon you. To compensate with regard to this type of trouble, it’s possible to consult the vendor to reduced his price tag.

Leave a Reply