profile
viewpoint
Trevor Norris trevnorris NodeSource Salt Lake City, UT http://blog.trevnorris.com/

nodejs/nan 2706

Native Abstractions for Node.js

trevnorris/cbuffer 168

JavaScript Circular Buffer

indutny/caine 144

Friendly butler

nodejs/benchmarking 143

Node.js Benchmarking Working Group

trevnorris/buffer-dispose 46

Incredibly unsafe way to free a Buffer

indutny/hash-cracker 20

V8 Hash Seed timing attack

nodesource/event-loop-demo 11

Example server demonstrating effect of processing load and response times

indutny/talks 8

Slides from talks

trevnorris/defactor 7

A Deferred Factory Object

dshaw/node-error-handling 5

Node Error Handing Mini Summit

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha b1ac7c33e1705fce5c7e8131632b1f35647c583e

Add several dwarf planets to orbit

view details

push time in a month

push eventtrevnorris/.vim

Trevor Norris

commit sha 81df402c916093866dcbbb629e35f8a2d6c43cad

Few changes to vimrc

view details

push time in a month

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 66b9e474761cb1fc1e28abb7af2bdf843e6e7ab1

Few improvements

view details

push time in a month

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha e830e0d219c9bbc462d043c7762466dede30c347

Attempting a few optimizations on the Vector lib

view details

push time in a month

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 86575b88bc2bdeb1f13ad0838e2e62f57018655f

Use full implementation from threaded impl

view details

Trevor Norris

commit sha b827667cd69f2912a6633439461b5a22165304bb

Attempting a few optimizations on the Vector lib

view details

push time in a month

pull request commentlibuv/libuv

test: fix pthread memory leak

@cjihrig yup, and thank you.

trevnorris

comment created time in 2 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 31d29fee7615e2acc912c142f2e60df8ba443042

Add another function to make things simpler Need to figure out a workflow that'll make it easier to generate the end results I want from the basic inputs to automatically running the orbital simulator and recording its information.

view details

push time in 2 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha e1cfb7ff84a032ef70f14b8f757e75df4d861d6c

Add fns and update some constants Big one is star_to_period() that will take information about the star and return the orbit of the planet in seconds. Useful to calculate the habitable orbit for a star with given parameters.

view details

push time in 2 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha c8917dff030197b911a4adf33ed73c89ff577197

Add JS implementation and other utils Start to unify the mess of implementations to make an actually usable library. Also add utilities to calculate the semi major axis of a planet based on what type of star it's orbiting.

view details

push time in 2 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha cfcb99db46dabcb45731cf82fbb4f177d4717acf

Calc effective temp + other stuff Also tried to make improvements to the threaded implementation, but haven't been able to help that yet. Should run multiple planet calculations on each thread to overcome the performance barrier. There's also no more need for the data scraping script.

view details

push time in 2 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 1b429198471f4584f068b8d9861aad5001b14594

Calc effective temp + other stuff Also tried to make improvements to the threaded implementation, but haven't been able to help that yet. Should run multiple planet calculations on each thread to overcome the performance barrier. There's also no more need for the data scraping script.

view details

push time in 2 months

pull request commentlibuv/libuv

test: fix pthread memory leak

@richardlau ping

trevnorris

comment created time in 2 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 3a5b1a332dfb11b323363e1c4983c0837305e2dc

Whole ton of changes Most notable is the work on planets-threaded.cc, which properly uses all orbital components and working on running in multiple threads.

view details

push time in 2 months

create barnchtrevnorris/libuv

branch : fix-thread-test-leak

created branch time in 2 months

push eventtrevnorris/libuv

Trevor Norris

commit sha 71804f68aa75d8b0b241c3fb5028e13b428c6e67

test: fix pthread memory leak When the thread attributes object returned by pthread_getattr_np() is no longer required, it should be destroyed using pthread_attr_destroy(). PR-URL: https://github.com/libuv/libuv/pull/2583

view details

push time in 2 months

PR opened libuv/libuv

test: fix pthread memory leak

When the thread attributes object returned by pthread_getattr_np() is no longer required, it should be destroyed using pthread_attr_destroy().

+1 -0

0 comment

1 changed file

pr created time in 2 months

startedstdlib-js/stdlib

started time in 3 months

issue closednodejs/node

Commit 2695f82 causes re-read of packages

  • Version: v12.13.1
  • Platform: Linux
  • Subsystem: module

A change in commit 2695f82 (specifically https://github.com/nodejs/node/commit/2695f82#diff-76195ce57689942222a27f0dbda6d3b7L966) runs readPackage() more frequently than before.

Adding the following patch

diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index 64505220ab..be3cec3208 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -219,6 +219,7 @@ Module._debug = deprecate(debug, 'Module._debug is deprecated.', 'DEP0077');
 const packageJsonCache = new SafeMap();
 
 function readPackage(requestPath) {
+  debug('reading package %j', requestPath);
   const jsonPath = path.resolve(requestPath, 'package.json');
 
   const existing = packageJsonCache.get(jsonPath);

Then produces the following:

$ NODE_DEBUG=module ./node test/parallel/test-module-children.js 2>&1 | grep "reading package"
MODULE 25596: reading package "/var/projects/node/test/parallel"
MODULE 25596: reading package "/var/projects/node/test"
MODULE 25596: reading package "/var/projects/node"
MODULE 25596: reading package "/var/projects"
MODULE 25596: reading package "/var"
MODULE 25596: reading package "/var/projects/node/test/common"
MODULE 25596: reading package "/var/projects/node/test/common"
MODULE 25596: reading package "/var/projects/node/test"
MODULE 25596: reading package "/var/projects/node"
MODULE 25596: reading package "/var/projects"
MODULE 25596: reading package "/var"
MODULE 25596: reading package "/var/projects/node/test/common"
MODULE 25596: reading package "/var/projects/node/test"
MODULE 25596: reading package "/var/projects/node"
MODULE 25596: reading package "/var/projects"
MODULE 25596: reading package "/var"
MODULE 25605: reading package "/var/projects/node/test/parallel"
MODULE 25605: reading package "/var/projects/node/test"
MODULE 25605: reading package "/var/projects/node"
MODULE 25605: reading package "/var/projects"
MODULE 25605: reading package "/var"
MODULE 25605: reading package "/var/projects/node/test/common"
MODULE 25605: reading package "/var/projects/node/test/common"
MODULE 25605: reading package "/var/projects/node/test"
MODULE 25605: reading package "/var/projects/node"
MODULE 25605: reading package "/var/projects"
MODULE 25605: reading package "/var"
MODULE 25605: reading package "/var/projects/node/test/common"
MODULE 25605: reading package "/var/projects/node/test"
MODULE 25605: reading package "/var/projects/node"
MODULE 25605: reading package "/var/projects"
MODULE 25605: reading package "/var"
MODULE 25605: reading package "/var/projects/node/test/common"
MODULE 25605: reading package "/var/projects/node/test"
MODULE 25605: reading package "/var/projects/node"
MODULE 25605: reading package "/var/projects"
MODULE 25605: reading package "/var"
MODULE 25605: reading package "/var/projects/node/test/fixtures/GH-7131"
MODULE 25605: reading package "/var/projects/node/test/fixtures"
MODULE 25605: reading package "/var/projects/node/test"
MODULE 25605: reading package "/var/projects/node"
MODULE 25605: reading package "/var/projects"
MODULE 25605: reading package "/var"
MODULE 25605: reading package "/var/projects/node/test/fixtures/GH-7131"
MODULE 25605: reading package "/var/projects/node/test/fixtures"
MODULE 25605: reading package "/var/projects/node/test"
MODULE 25605: reading package "/var/projects/node"
MODULE 25605: reading package "/var/projects"
MODULE 25605: reading package "/var"

Adding this check back that was removed in 2695f82:

 // Native extension for .js
 let warnRequireESM = true;
 Module._extensions['.js'] = function(module, filename) {
-  if (filename.endsWith('.js')) {
+  if (experimentalModules && filename.endsWith('.js')) {
     const pkg = readPackageScope(filename);
     if (pkg && pkg.data && pkg.data.type === 'module') {
       if (warnRequireESM) {

Shows that readPackage() runs much less:

$ NODE_DEBUG=module ./node test/parallel/test-module-children.js 2>&1 | grep "reading package"
MODULE 26034: reading package "/var/projects/node/test/common"
MODULE 26043: reading package "/var/projects/node/test/common"

closed time in 3 months

trevnorris

issue commentnodejs/node

Commit 2695f82 causes re-read of packages

Then I'll consider this resolved. Thanks.

trevnorris

comment created time in 3 months

issue commentnodejs/node

Commit 2695f82 causes re-read of packages

Changing the patch to:

diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index 64505220ab..c6df83dd32 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -224,6 +224,7 @@ function readPackage(requestPath) {
   const existing = packageJsonCache.get(jsonPath);
   if (existing !== undefined) return existing;
 
+  debug('reading package %j', requestPath);
   const json = internalModuleReadJSON(path.toNamespacedPath(jsonPath));
   if (json === undefined) {
     packageJsonCache.set(jsonPath, false);

returns the following:

$ NODE_DEBUG=module ./node test/parallel/test-module-children.js 2>&1 | grep "reading package"
MODULE 28389: reading package "/var/projects/node/test/parallel"
MODULE 28389: reading package "/var/projects/node/test"
MODULE 28389: reading package "/var/projects/node"
MODULE 28389: reading package "/var/projects"
MODULE 28389: reading package "/var"
MODULE 28389: reading package "/var/projects/node/test/common"
MODULE 28398: reading package "/var/projects/node/test/parallel"
MODULE 28398: reading package "/var/projects/node/test"
MODULE 28398: reading package "/var/projects/node"
MODULE 28398: reading package "/var/projects"
MODULE 28398: reading package "/var"
MODULE 28398: reading package "/var/projects/node/test/common"
MODULE 28398: reading package "/var/projects/node/test/fixtures/GH-7131"
MODULE 28398: reading package "/var/projects/node/test/fixtures"

I assume that because packageJsonCache is now a SafeMap it's getting cleared and allowing the same paths to be fetched multiple times.

trevnorris

comment created time in 3 months

issue openednodejs/node

Commit 2695f82 causes re-read of packages

  • Version: v12.13.1
  • Platform: Linux
  • Subsystem: module

A change in commit 2695f82 (specifically https://github.com/nodejs/node/commit/2695f82#diff-76195ce57689942222a27f0dbda6d3b7L966) runs readPackage() more frequently than before.

Adding the following patch

diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index 64505220ab..be3cec3208 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -219,6 +219,7 @@ Module._debug = deprecate(debug, 'Module._debug is deprecated.', 'DEP0077');
 const packageJsonCache = new SafeMap();
 
 function readPackage(requestPath) {
+  debug('reading package %j', requestPath);
   const jsonPath = path.resolve(requestPath, 'package.json');
 
   const existing = packageJsonCache.get(jsonPath);

Then produces the following:

$ NODE_DEBUG=module ./node test/parallel/test-module-children.js 2>&1 | grep "reading package"
MODULE 25596: reading package "/var/projects/node/test/parallel"
MODULE 25596: reading package "/var/projects/node/test"
MODULE 25596: reading package "/var/projects/node"
MODULE 25596: reading package "/var/projects"
MODULE 25596: reading package "/var"
MODULE 25596: reading package "/var/projects/node/test/common"
MODULE 25596: reading package "/var/projects/node/test/common"
MODULE 25596: reading package "/var/projects/node/test"
MODULE 25596: reading package "/var/projects/node"
MODULE 25596: reading package "/var/projects"
MODULE 25596: reading package "/var"
MODULE 25596: reading package "/var/projects/node/test/common"
MODULE 25596: reading package "/var/projects/node/test"
MODULE 25596: reading package "/var/projects/node"
MODULE 25596: reading package "/var/projects"
MODULE 25596: reading package "/var"
MODULE 25605: reading package "/var/projects/node/test/parallel"
MODULE 25605: reading package "/var/projects/node/test"
MODULE 25605: reading package "/var/projects/node"
MODULE 25605: reading package "/var/projects"
MODULE 25605: reading package "/var"
MODULE 25605: reading package "/var/projects/node/test/common"
MODULE 25605: reading package "/var/projects/node/test/common"
MODULE 25605: reading package "/var/projects/node/test"
MODULE 25605: reading package "/var/projects/node"
MODULE 25605: reading package "/var/projects"
MODULE 25605: reading package "/var"
MODULE 25605: reading package "/var/projects/node/test/common"
MODULE 25605: reading package "/var/projects/node/test"
MODULE 25605: reading package "/var/projects/node"
MODULE 25605: reading package "/var/projects"
MODULE 25605: reading package "/var"
MODULE 25605: reading package "/var/projects/node/test/common"
MODULE 25605: reading package "/var/projects/node/test"
MODULE 25605: reading package "/var/projects/node"
MODULE 25605: reading package "/var/projects"
MODULE 25605: reading package "/var"
MODULE 25605: reading package "/var/projects/node/test/fixtures/GH-7131"
MODULE 25605: reading package "/var/projects/node/test/fixtures"
MODULE 25605: reading package "/var/projects/node/test"
MODULE 25605: reading package "/var/projects/node"
MODULE 25605: reading package "/var/projects"
MODULE 25605: reading package "/var"
MODULE 25605: reading package "/var/projects/node/test/fixtures/GH-7131"
MODULE 25605: reading package "/var/projects/node/test/fixtures"
MODULE 25605: reading package "/var/projects/node/test"
MODULE 25605: reading package "/var/projects/node"
MODULE 25605: reading package "/var/projects"
MODULE 25605: reading package "/var"

Adding this check back that was removed in 2695f82:

 // Native extension for .js
 let warnRequireESM = true;
 Module._extensions['.js'] = function(module, filename) {
-  if (filename.endsWith('.js')) {
+  if (experimentalModules && filename.endsWith('.js')) {
     const pkg = readPackageScope(filename);
     if (pkg && pkg.data && pkg.data.type === 'module') {
       if (warnRequireESM) {

Shows that readPackage() runs much less:

$ NODE_DEBUG=module ./node test/parallel/test-module-children.js 2>&1 | grep "reading package"
MODULE 26034: reading package "/var/projects/node/test/common"
MODULE 26043: reading package "/var/projects/node/test/common"

created time in 3 months

issue commentjstat/jstat

typescript

I'll accept a PR for them.

lukas1994

comment created time in 3 months

issue commentjstat/jstat

typescript

Sorry, not following. Can you explain in more detail?

lukas1994

comment created time in 3 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 76cbad2e4481dc3c580dfee87271cb6f74cb2676

Routine check-in A lot of changes are happening. Especially with calculation of the planets initial position and velocity. So check things in here before making any more big changes.

view details

push time in 4 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 1e7261ab43d4b0de0fe8c5613936a15b57be702b

Update some misc functions that needed correction Also include a function to return the orbital period.

view details

push time in 4 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha fa285c3d1386d13d75c7220c60c95708b1ecbe02

Small update to Vector

view details

push time in 4 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 31536d0b81e3930fbc581710ca1d52baf0bb175e

First attempt at SystemBodies

view details

push time in 4 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 1f56843786540b7b840f2657bf9bc67f2497e507

First attempt at SystemBodies

view details

push time in 4 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 616cde106db3c3e6477ce611c9fe3324188fd995

First commit of math_vector.h

view details

push time in 4 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 23e4bfda4eee49c152c7abc8b005402fb86ad2ed

First commit of math_vector.h

view details

push time in 4 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 10c108664d6ee59e435669519bd9c3a23ed326c3

First commit of math_vector.h

view details

push time in 4 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 11c16349641408e5272cf8b6ec0f6d867f699326

First commit of math_vector.h

view details

push time in 4 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha fa0562a217fe18aeb9079a859921a2b0a6e98b31

First commit of math_vector.h

view details

push time in 4 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 839c7a1988143e47b035c586569bf79495278c7d

First commit of math_vector.h

view details

push time in 4 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha b0f6c7316186475f80710d6f85cd9f63fd348dc2

First commit of math_vector.h

view details

push time in 4 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 1fe618def864f4b6b7c74523572c43d33d3ea83b

First commit of math_vector.h

view details

push time in 4 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha ad36a919a1a68e2224ad49300b22968286307578

First commit of math_vector.h

view details

push time in 4 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha ca174c3cf63c30ef638256c47490c29e67c03f4c

First commit of math_vector.h

view details

push time in 4 months

issue closedjstat/jstat

fn.variance & fn.stdev - flag population/sample

In the static methods for variance() and stdev() a flag can be passed to indicate whether to compute the population or the sample for matrices. This cannot be done for the instance methods. Though it should be implemented.

closed time in 4 months

trevnorris

issue commentjstat/jstat

Gamma Function has nonsensical behavior with large arguments

Would something like this work for you?

@@ -72,6 +72,9 @@ jStat.gammafn = function gammafn(x) {
   var xnum = 0;
   var y = x;
   var i, z, yi, res;
+  if (x > 171.6243769536076) {
+    return Infinity;
+  }
   if (y <= 0) {
     res = y % 1 + 3.6e-16;
     if (res) {

It immediately checks for the maximum non infinite value, and returns immediately if it's greater than that.

Also, it appears that gammafn() fails with negative numbers, but I'm not sure what the expected behavior of that should be.

mscotch1

comment created time in 4 months

issue commentjstat/jstat

Regression: If a variable contains all zero then code breaks

I've done some investigation and implementing this reliably will take some time. I was also thinking to add a throwOnNaN() option that will throw (like it currently does) when a NaN would be returned. Mainly to help debugging.

samipjain

comment created time in 4 months

push eventjstat/jstat

Trevor Norris

commit sha f5a03f276fe3baf2630c05cda5a3a9db412d6c77

Update to building stuff

view details

Trevor Norris

commit sha bef37864642a70bee49c03f57a0a1da22a04a890

Fix isNumber implementation change * Didn't rename the argument passed to isNumber, causing false to always be returned. * Be more strict. Strings as numbers are not considered numbers. Fixes: a55cee0 "Change isNumber implementation"

view details

Trevor Norris

commit sha e5c469e75c0d8b72059facce763d3d547353f700

Release v1.9.2

view details

push time in 4 months

issue openedjstat/jstat

Update docs with new poisson distribution

Update docs with info in https://github.com/jstat/jstat/pull/246#issuecomment-526445406

created time in 5 months

issue commentjstat/jstat

Evaluate function?

It doesn't, but this is a feature I thought would be interesting to include. mathjs has a good implementation example I'll be able to pull from. No promises it'll be done soon, so PRs are welcome. :)

koosvanderkolk

comment created time in 5 months

issue commentjstat/jstat

Regression: If a variable contains all zero then code breaks

@samipjain What about returning NaN? I think that would indicate the input parameters aren't valid.

samipjain

comment created time in 5 months

PR opened typpo/spacekit

Match AU in km to docs

In docs/file/src/Ephem.js.html has METERS_IN_AU at 149597870700, but both kmToAu() and auToKm() used the value 149598000.

+2 -2

0 comment

1 changed file

pr created time in 5 months

create barnchtrevnorris/spacekit

branch : fixAUdistance

created branch time in 5 months

fork trevnorris/spacekit

Javascript library for 3D space visualizations

fork in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha d2e88af938493505ae2ead578365524c8d3e8538

Big check-in Lots going on, and mostly a big mess, but want to make sure nothing is lost.

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 319680e19c302c7622c089cc29bdcd2a7ab91cf6

Initial attempt at matching the JS API in C++ Calculations should be correct, but doesn't yet read an ini file.

view details

Trevor Norris

commit sha b0977bd88dd24da7d58b80e30887aeef2cecabf4

Fix bug where sun's position isn't changed

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 86ce53242957a5e23fcbf305d63e8354a92c6990

Initial attempt at matching the JS API in C++ The calculations aren't quite correct. Working on that.

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha b873eb91fd4e54f5407b4ce67d3375d0d82c35ec

Adjust orbit for gravitational time dialation Also improve logging, track additional info, etc.

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 4f848a580477915b7c2682c3acfb5ee8e8a6f090

Fix bug in Vector() Vector#set() set y twice instead of setting z.

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 07f2914b2a17a20d89f5e6b3bb9670ad8eccafbd

Improve library and how calculations are done * Add more constants. * Remove AVG_APSIS as it wasn't a good for calculations. * Add misc functions. The current set of functions provide measurements for gravitational perihelion shift and gravitational time dialation. They will be used for calculating more precise measurements of planet's orbits. * Calculate initial velocity of planet by using its eccentricity and aphelion and the sun's mass. * Improve how each planet's orbit is initialized and calculated. * Improve test script output. * Print estimated remaining time when processing test.

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 276157bcc2bbb35b0ddb31adb9cfa7d03a39af01

Improve library and how calculations are done * Add more constants. * Remove AVG_APSIS as it wasn't a good for calculations. * Add misc functions. The current set of functions provide measurements for gravitational perihelion shift and gravitational time dialation. They will be used for calculating more precise measurements of planet's orbits. * Calculate initial velocity of planet by using its eccentricity and aphelion and the sun's mass. * Improve how each planet's orbit is initialized and calculated. * Improve test script output. * Print estimated remaining time when processing test.

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 88e7ce1785039ca1b8d332b33f3144152d369ed5

Create new SystemBody API Instead of needing to manually set all the coordinates for position and velocity, instead calculate everything from the semi-major axis, eccentricity and mass.

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha a94199b17567118698312641a109089cf569ab7d

Add xsimd version of planets.cc

view details

Trevor Norris

commit sha f82629be8d3204fb5d6ee035ee346b442ae23d9a

First pass at doing planets using SIMD But the calculations are off, and it's not as fast as it could be. So trying again.

view details

Trevor Norris

commit sha 5e9cb49d0107a9da1e780fbf09bbad7e9ba28d7d

Attempt new way of creating solar system

view details

Trevor Norris

commit sha e565a00af7c10cf66089b37b268dd3be6ad8a859

Create array of Planet classes Prevent the need to new Planet by creating an array of them first. This limits the number of planets to 1024, but hopefully that's good.

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 281006ea2a553ce1287a930f107c434bc9a9b93e

Fix number of steps taken in calculating years Shouldn't be multiplying by the step length, or the same number of steps will always be taken.

view details

Trevor Norris

commit sha f5c58b8fdc20e2e005489477c0d541f2b2f4edda

Improve variable names to match physics equations

view details

Trevor Norris

commit sha 8c7cfc433907f7e13f991a2596836cdbf71c6967

Allow for no "sun" to be passed.

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 4f9b19b861bc2b94ccea2f5222ef27329dc6ef92

Reduce the number of sqrt() calls By calculating the sqrt() once then using it for both planets the number of calls to sqrt() is halved. This offers up to a ~20% performance boost.

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 870441186e8fdd98bd7f7e54bb9c0ba307ce1889

Improve performance by removing a mulitiply I must have been off my rocker to multiply the inverse sqrt twice instead of storing the un-sqrt'd result before then divide by that.

view details

Trevor Norris

commit sha 0b7e91492da14d9eb275f896840f9247c38247cc

Reorder the functions Position and velocity are updated before acceleration is. So put that function first.

view details

push time in 5 months

issue commentjstat/jstat

Check for even/odd length to get exact median

Roger. Will take care of this.

samipjain

comment created time in 5 months

issue commentjstat/jstat

Regression: If a variable contains all zero then code breaks

I'm happy to handle the divide by zero case differently. Whatever decision is made I'd like to implement uniformly across the library. So I'd like to make sure this is usable in the general case.

The problem with simply returning null or undefined is that it wouldn't communicate the reason for the error. Returning an Error object isn't something done in JS. Adding a callback or Promise, even though it's not actually async at the moment, would allow for an error to be passed.

I'll think on it more and look across the library for example use cases. If you have any other ideas let me know.

samipjain

comment created time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 903d83641e20a12ca5ad10ce4c7e691d74edb9dc

Further fix the output Shouldn't have used %e for printing distance in AU.

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 913a1200cdf5bb02f1f0c62fb0b7827fbdec0cd4

Make output look better Printing the AU from the sun shouldn't use %e.

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha aca3b0ee426ecd48b292572cbe00d59dd5599a45

Change variable names The results are dx, not x.

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha aa32a0a9eaed9d439bb3302b873d0ac5bb4f69d4

Change variable names The results are dx, not x.

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 5753fd1a3dacb83a0bd99abf85f4628ad69813af

Separate loop operations for better performance By moving one inline function call into its own loop performance has increased by ~30%.

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha a15bcfed03afde4ed4736f28017141147634be51

Tighten loops and calculations Switch vector iterators to use auto, and change add_acceleration() to calculate without mag().

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 086b76d83d7c91a83db1f8c4f589ce3f975b3b02

Tighten loops and calculations Switch vector iterators to use auto, and change add_acceleration() to calculate without mag().

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 0654605dab8f81cfec2bd8a54c94d9fe53f3ead3

Tighten loops and calculations Switch vector iterators to use auto, and change add_acceleration() to calculate without mag().

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 9b7151dc3738b1258cc7bd157b614e55e7139de1

Tighten loops and calculations Switch vector iterators to use auto, and change add_acceleration() to calculate without mag().

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 79b2ea258ab123278eb270c223825c6832e7d31d

Make functions static inline where applicable

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 39286c53b4ffc9c46c874535cc639805daef6ecc

Move len() closer to usage, switch to inv sqrt

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha 2b7b601f940c99a3836cb69c0a44132843984992

Add -y --years to run for years instead of time

view details

push time in 5 months

push eventtrevnorris/planetary_motion

Trevor Norris

commit sha c2a94da00cf252ee15b7ad55ab8c064cff4c72fe

Do further work on C++ impl Allow passing in an ini file that contains all the necessary planet info to begin the model, and a few command line options to specify the step interval and total duration of the test. Also support reporting all info that has been collected when receiving SIGINT.

view details

push time in 5 months

issue commentnodejs/node

test/async-hooks/test-callback-error.js always produces core file

Thank you for the fix.

trevnorris

comment created time in 5 months

more