Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lastolivegames/becsy

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lastolivegames/becsy

A multithreaded Entity Component System (ECS) for TypeScript and JavaScript, inspired by [ECSY](https://github.com/ecsyjs/ecsy) and [bitecs](https://github.com/NateTheGreatt/bitECS), and guided by [ideas from Flecs](https://ajmmertens.medium.com/why-vanil

  • 0.2.0
  • npm
  • Socket score

Version published
Weekly downloads
169
increased by36.29%
Maintainers
1
Weekly downloads
 
Created
Source

becsy

A multithreaded Entity Component System (ECS) for TypeScript and JavaScript, inspired by ECSY and bitecs, and guided by ideas from Flecs.

From ECSY we take:

  • a friendly object-oriented API for both JS and TS clients
  • multiple queries per system
  • reactive queries (rather than event callbacks)
  • explicit mutation tracking
  • references to native JS objects in components

From bitecs we take:

  • extensive use of ArrayBuffer for performance
  • a sparse array architecture
  • Node and browser compatibility with no dependencies

Then we add:

  • selectable component storage strategies, to adjust the performance/memory trade-off
  • weak references to native JS objects, for better integration with other frameworks
  • entity references that can be traversed in either direction
  • declarative system ordering based on data dependencies
  • built-in support for representing state machines (per Sander Mertens)
  • multithreaded system execution
  • an optional but nicely integrated networked data replication system

Overall, becsy aims to be feature rich without sacrificing too much performance. The goal is to be 10x faster than ECSY when single-threaded, and faster than bitecs when multithreaded as long as the problem is parallelizable. Here's a snapshot of current performance per ecs-benchmark -- note that there are separate development and performance builds of becsy, with all safety checks removed from the latter:

packed_1packed_5simple_iterfrag_iterentity_cycleadd_remove
becsy14,661 op/s15,994 op/s2,877 op/s29,098 op/s1,166 op/s5,166 op/s
becsy/perf57,102 op/s56,185 op/s35,354 op/s93,403 op/s1,063 op/s6,651 op/s
bitecs185,036 op/s182,400 op/s114,440 op/s376,528 op/s1,790 op/s3,357 op/s
ecsy4,769 op/s3,197 op/s2,174 op/s12,033 op/s18 op/s397 op/s

FAQs

Package last updated on 26 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc