Skip to main content

News

Topic: neoSphere 5.9.2 (Read 520129 times) previous topic - next topic

0 Members and 4 Guests are viewing this topic.
  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: miniSphere 5.2.12
Reply #2220
Okay, so I know I said that 5.2.11 would be the last 5.2 release, but the bug fixes were starting to pile up so I decided to put out another patch.  Besides bug fixes I also added an explanation of API levels to the documentation as well as showing which level each function requires.  Experimental functions are marked as such.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: miniSphere 5.3 beta 1 (stable: 5.2.13)
Reply #2221
The first beta of miniSphere 5.3 is out, bringing some new APIs and several useful features, including cell init for initializing a new, working project directly from the command-line (no Sphere Studio required!).  More will be coming, but this seemed like a good point to push out a beta to hopefully get some field testing in on the new features, especially cell init.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: miniSphere 5.3b1 (stable: 5.2.13)
Reply #2222
Starting in miniSphere 5.3, from() will be built into the Core API without the need to import the "from" module.  Like @Radnen 's Link.js library that came before it, from() queries are often incredibly useful in battle engines, and now I've written some code in the engine to compile these queries directly to JS for super-fast performance.

Code: (JavaScript) [Select]
let dinnerAmount = from(worldPopulation)
    .where(it => pig.isHungryFor(it))
    .besides(it => pig.devour(it))
    .reduce((a, it) => a + it.weight, 0);
SSj.log(`the pig just gained ${dinnerAmount} lbs.`);
  • Last Edit: November 17, 2018, 03:24:15 pm by Fat Cerberus
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: miniSphere 5.3b1 (stable: 5.2.13)
Reply #2223
So when I said above that from queries would be blazing fast, I meant it, and to prove it I've done a quick benchmark of other similar solutions:
Code: (javascript) [Select]
let fromQuery = new Query()
.where(it => it % 2 === 0)
.take(10000)
.select(it => it + 1)
.reduce((a, it) => a + it, 0);
Code: [Select]
 event                    count   time (us)   % run  avg (us)    % avg |
------------------------------------------------------------------------
 Array method chain       1,001   3,605,798  34.1 %     3,602   34.3 % |
 Underscore chain         1,001   2,065,016  19.5 %     2,062   19.6 % |
 Lodash chain             1,001   1,168,390  11.0 %     1,167   11.1 % |
 from.js 1.0              1,001     903,805   8.5 %       902    8.6 % |
 from.ts (Oozaru)         1,001     875,786   8.3 %       874    8.3 % |
 Link.js query            1,001     475,447   4.5 %       474    4.5 % |
 Link.js query (NR)       1,001     325,084   3.1 %       324    3.1 % |
 from.js 2.0              1,001     319,423   3.0 %       319    3.0 % |
 Lazy.js sequence         1,001     270,130   2.6 %       269    2.6 % |
 Sphere from() query      1,001     205,757   1.9 %       205    2.0 % |
 Sphere Query object      1,001     188,966   1.8 %       188    1.8 % |
 handwritten 'for' loop   1,001     119,092   1.1 %       118    1.1 % |

Sphere from() query and Sphere Query object is us!  All timings are for running a chain equivalent to the above query 1,000 times with the respective library over an array of 100,000 random integers between 0 and 1000.

Special thanks to @Radnen for (indirectly) giving me the idea - Link.js was touted as a replacement for writing repetitive for loops, which got me to thinking... what if I just compile the query to an actual for loop...

This is really incredible that I was able to get so close to native loop performance and is a big win for code readability.  Query chains remain understandable even with 10+ query operators chained together, but throw together a couple filters and mappings plus a sort (or two!) and the set of for loops you need to write to match it can get pretty gnarly.  Lodash is proof people are willing to sacrifice a great deal of performance to get more readable code (see benchmark results above), even in tight loops where it matters most, but it's even better if you don't have to. :smiley_cat:
  • Last Edit: November 20, 2018, 02:14:13 am by Fat Cerberus
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: miniSphere 5.3b1 (stable: 5.2.13)
Reply #2224
I'm still baffled the widespread popularity of lodash... when libraries you and I write can be an order of magnitude faster, and any missing convenience methods lodash has, can always be added.

Anyways, I didn't have from.js on me, but I ran your parameters on my new Linkier library along with lazy and Link and got:
Code: ('js') [Select]
const Linkier = require('./linkier.js');
const Link = require('./modules/link.js');
const Lazy = require('./modules/lazy.js');
const Benchmark = require('benchmark');

// Generate a random list of 100,000 integer between 0 and 1,000.
const items = [];
for (let i = 0; i < 100000; ++i) {
    items[i] = Math.floor(Math.random() * 1001);
}

const suite = new Benchmark.Suite;
const linkier = Linkier(items).filter(n => n % 2 === 0).take(10000).map(n => n + 1);
const link = Link(items).filter(n => n % 2 === 0).take(10000).map(n => n + 1);
const lazy = Lazy(items).filter(n => n % 2 === 0).take(10000).map(n => n + 1);

suite.add('Linkier', function() {
    linkier.reduce((a, n) => a + n, 0);
}).add('Link', function() {
    link.reduce((a, n) => a + n, 0);
}).add('Lazy', function() {
    lazy.reduce((a, n) => a + n, 0);
}).add('For Loop', function() {
    let n = 0;
    let r = 0;
    for (let i = 0; i < items.length; ++i) {
        if (items[i] % 2 === 0) {
            n++;
            if (n <= 10000) {
                const m = items[i] + 1;
                r = r + m;
            }
        }
    }
}).add('For Loop 2', function() {
    let n = 0;
    let r = 0;
    for (let i = 0; i < items.length; ++i) {
        if (items[i] % 2 === 0) {
            n++;
            if (n <= 10000) {
                const m = items[i] + 1;
                r = r + m;
            } else {
                break;
            }
        }
    }
}).on('cycle', (event) => {
    console.log(String(event.target));
}).on('complete', function() {
    console.log('Fastest is: ' + this.filter('fastest').map('name'));
}).run({ async: true });

Code: [Select]
Linkier x 4,242 ops/sec ±5.49% (78 runs sampled)
Link x 3,786 ops/sec ±2.13% (91 runs sampled)
Lazy x 2,917 ops/sec ±2.87% (91 runs sampled)
For Loop x 2,213 ops/sec ±2.01% (96 runs sampled)
For Loop 2 x 11,052 ops/sec ±1.52% (97 runs sampled)
Fastest is: For Loop 2

What we learn here, is that hand-writing a for loop can be slower... The first for loop doesn't short circuit after 10,000 items, but that's on intention. How many times in writing a for loop you think of doing that? Therefore from.js, link.js and other libraries are going to be faster since they can make those common-sense decisions for you, and just automatically make your code faster.
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: miniSphere 5.3b2 (stable: 5.2.13)
Reply #2225
miniSphere 5.3 release is very close - just a few more API kinks I have to work out but otherwise everything is ready to go.

I even made a last-minute API addition: you'll be able to create custom BlendOps to have better control over the blending stage of the graphics pipeline.  This is something that can't be handled in the fragment shader at all--blending is still fixed-function even on modern hardware.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: miniSphere 5.3.0 RC1
Reply #2226
miniSphere 5.3.0 RC1 is now available for download!  This is a release candidate, which means the code is essentially frozen; no further changes will be made other than bug fixes for 5.3.  If no major issues are reported, this exact build will become the final version of miniSphere 5.3.0.

There's way too much new stuff to list here (5.3 ended up way bigger than I originally planned), so just check out the release notes on GitHub:
https://github.com/fatcerberus/minisphere/releases/tag/v5.3rc1
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: miniSphere 5.3.0
Reply #2227
miniSphere 5.3.0 has just been released and is now available for download.  This version brings a ton of new APIs, a brand-new, faster version of from.js rewritten from the ground up, bumps the API level to 2, brings back support for 32-bit versions of Windows in the official release, adjusts script-loading semantics to allow using .js for modules (it's like a long lost friend coming back home :P), and so much more.

Be extra sure to check out the Release Notes for this release before getting started, as there are several potentially breaking changes due to modified semantics in a few places (the Core API remains backward compatible, as promised by the mS 5.0.0 API freeze).  And for Windows users, as always with milestone releases, uninstall your previous version of miniSphere before installing 5.3.0 to ensure all stale files get removed.

Merry Christmas everybody!
:santa: :christmas_tree::gift:
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: miniSphere 5.4.0
Reply #2228
miniSphere 5.4.0 is out.  I kind of rushed the release because 5.3 was released almost a year ago; please let me know of any bugs!

This version adds support for the .cjs (CommonJS) extension and introduces a new development.strictImports flag to game.json which forces import to be Oozaru-compatible (i.e. it forces you to include the extension for any imports of scripts inside your project), and a bunch of other enhancements.

See the release page for the full list of changes:
https://github.com/fatcerberus/minisphere/releases/tag/v5.4.0
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: miniSphere 5.4.2
Reply #2229
Just posted a quick update: miniSphere 5.4.2.  A few of the currently-experimental APIs were renamed, so be sure to check the changelog to see if the renames affect you.
  • Last Edit: February 20, 2020, 02:46:22 am by Fat Cerberus
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: miniSphere 5.5.0
Reply #2230
I don't know if anyone still even uses the forums anymore, but...

Just posted a new miniSphere version, 5.5.0, with a bunch of miscellaneous changes.  Notably the .fromFile() APIs are canonized and API level has been increased to 3.

Just as a quick heads-up, there's an upcoming rebranding: While the engine itself will continue to be called miniSphere to differentiate it from Oozaru (the Web implementation), the download itself will be renamed to Sphere. Not sure when I'm going to do this, but it'll be soon.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: miniSphere 5.5.0
Reply #2231
miniSphere is Sphere now. Good job Fat Cerberus! Congrats on the v5.5.0 release. :)
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Sphere 5.5.1 Official Release (miniSphere)
Reply #2232
The Sphere 5.5.1 development kit has been released for Windows, beginning the rebranding effort mentioned a few posts back.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Sphere 5.5.1 (miniSphere)
Reply #2233
The next big feature I want to work on is Oozaru integration. Not sure how that's going to go yet, but the basic idea is to do something where Cell can include a copy of Oozaru with the compiled project. Then you just need to find a place to host it and you're good to go.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Sphere 5.5.1 (miniSphere)
Reply #2234
I don't know if anyone still even uses the forums anymore, but...

 O:)