• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
WitchLord

AngelScript 1.9.1 WIP 2 (2004/09/14)

4 posts in this topic

After finding out that Lua was about 2 times as fast as AngelScript I started thinking more about how to improve the performance. I already implemented the easiest optimizations which has improved the performance with about 30-50%. I have plenty of ideas for other changes that might improve the performance even more, and I'm certain that I will be able to make AS at least as fast as Lua. AngelScript has the advantage of being strongly typed and the ability to call C/C++ functions directly without wrapper functions. The ultimate optimization would be to compile directly to machine-code, but that is a step I'm not ready to take yet. That part will probably be done through a plug-in-able JIT compiler or something like that. I'm planning on making these optimizations gradually over time, as I would otherwise have to stop further development of the library features, which is not something that I want to do. Here are the changes for the latest WIP: - bug fix: Switch-case didn't work correctly if the cases were not ordered in ascending order (thanks Dmitry "RCL" Rekman) - bug fix: The ternary operator ?: didn't release temporary variables as it should, causing an assert failure in the debug version (thanks Dmitry "RCL" Rekman) - bug fix: Passing string constants to condition operator would cause an assertion failure. (thanks Joe "Desdemona" Wright) - Added support for asCALL_CDECL_OBJFIRST (thanks Tristan "Kurioes" Hartskeerl) - Improved performance of byte code execution with about 30% Regards, Andreas Jönsson Author of AngelScript [Edited by - WitchLord on September 14, 2004 7:44:05 PM]
0

Share this post


Link to post
Share on other sites
Hi,

I tried 1.9.1-WIP1 and I am pretty glad with the results. Performance gain is not just 30%-50% as you state. Right now the results are:

Lua: 20.499574 sec
AngelScript: 23.772902 sec

So it is nearly the same!!

I dunno why there is such a great performance boost. Older version performed nearly 2 times slower.

By the way, I did a mistake and AS version of performance test was not 100% identical to Lua version (there is one 'multiply' operation more each iteration, and the loop is one iteration less than Lua version). For tests to be identical, '*=' should be replaced with '=' in func3() for AS version and condition in 'for' loop should be changed from '<' to '<=' to match Lua's 'for'. I thought that could be the reason affecting performance, but even with the 100% identical tests, older version performs nearly 2 times as slow as Lua:

(Results for 1.9.0, 'tweaked' by me (ExecuteNext() rearranged, bcSize[] changed to enumerants), identical script )

Lua: 20.489861 sec
AngelScript: 36.730612 sec

Great work!

Cheers,
RCL
0

Share this post


Link to post
Share on other sites
Well, that is certainly great news. [smile] Already almost as fast as Lua, and I haven't even applied all the optimizations that I thought of. That was just the most simplest of them.

I don't know either why you get such an incredible performance improvement. When I measured the performance difference between 1.9.0 and 1.9.1 WIP1 it was only about 30%-50% faster. Could it be that you changed the compiler flags?

Wait a minute...

It's all about calculations:

1 - (23.77 / 36.73) = 0.35 (35% performance increase)

36.73 / 23.77 = 1.55 (1.9.0 is 54% slower than 1.9.1WIP1, or 65% as fast as 1.9.1WIP1)

23.77 / 20.50 = 1.16 (AS1.9.1WIP1 is 16% slower than Lua, or 86% as fast as Lua)

I'm not sure if the meaning of these calculations are actually what I think but I believe they are.

0

Share this post


Link to post
Share on other sites
I've just uploaded the second WIP. The changes are:

  • String constants are now concatenated by the compiler if they are only separated with whitespace or comments, i.e. "Hello " "Andreas" becomes "Hello Andreas"
  • asCALL_CDECL_OBJFIRST should now work, which allows application to register global functions as object methods where the first parameter is the object pointer
  • The ?: operator has been corrected once more due to bug reports that I received from Joe Wright


No optimizations were made in this update.


0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0